Skip to content

Conversation

@abrenk
Copy link

@abrenk abrenk commented Jan 19, 2026

This commit adds a new module to integrate with the OpenTelemetry Library Instrumentation for Oracle UCP.

@abrenk
Copy link
Author

abrenk commented Jan 19, 2026

Does it make sense to also implement BeanDestroyedEventListener or BeanPreDestroyEventListener?

@Override
public void onDestroyed(@NonNull BeanDestroyedEvent<UniversalConnectionPool> event) {
    final UniversalConnectionPool connectionPool = event.getBean();
    
    oracleUcpTelemetryConfiguration.oracleUcpTelemetry.unregisterMetrics(connectionPool);
}

or

@Override
public @NonNull UniversalConnectionPool onPreDestroy(@NonNull BeanPreDestroyEvent<UniversalConnectionPool> event) {
    final UniversalConnectionPool connectionPool = event.getBean();
    oracleUcpTelemetryConfiguration.oracleUcpTelemetry.unregisterMetrics(connectionPool);

    return connectionPool;
}

@abrenk
Copy link
Author

abrenk commented Jan 19, 2026

What needs to be done to fix the build error?

Execution failed for task ':micronaut-tracing-opentelemetry-ucp:findBaseline'.
> Could not find a previous version for 7.2.1

@radovanradic
Copy link

There are checkstyle errors

@radovanradic
Copy link

Does it make sense to also implement BeanDestroyedEventListener or BeanPreDestroyEventListener?

@Override
public void onDestroyed(@NonNull BeanDestroyedEvent<UniversalConnectionPool> event) {
    final UniversalConnectionPool connectionPool = event.getBean();
    
    oracleUcpTelemetryConfiguration.oracleUcpTelemetry.unregisterMetrics(connectionPool);
}

or

@Override
public @NonNull UniversalConnectionPool onPreDestroy(@NonNull BeanPreDestroyEvent<UniversalConnectionPool> event) {
    final UniversalConnectionPool connectionPool = event.getBean();
    oracleUcpTelemetryConfiguration.oracleUcpTelemetry.unregisterMetrics(connectionPool);

    return connectionPool;
}

Makes sense, I think BeanDestroyedEvent can be used

@radovanradic
Copy link

Can test be added, maybe similar to JdbcTelemetrySpanSpec

@n0tl3ss
Copy link
Member

n0tl3ss commented Jan 19, 2026

docs is missing from the src/main/docs/guide

@abrenk
Copy link
Author

abrenk commented Jan 19, 2026

Thanks for the reviews. I've done the following changes:

  • Set binaryCompatibility to '7.2.2'.
  • Implemented BeanDestroyedEventListener and therefore renamed the Listener class to UniversalConnectionPoolBeanEventListener.
  • Fixed the line endings Checkstyle was complaining about.
  • Written a new chapter for the guide.
  • Removed @ConfigurationBuilder(prefixes = "set")

Regarding an extended test case I'm not sure how to implement it without a running Oracle Database. Or should I try to use the Testcontainers Oracle-XE Module?

This commit adds a new module to integrate with the OpenTelemetry Library Instrumentation for Oracle UCP.
@n0tl3ss
Copy link
Member

n0tl3ss commented Jan 19, 2026

@radovanradic
Copy link

That is UCP, does not need to be Oracle connection. You can test it with H2 I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants