Skip to content

add stop-sending option#474

Merged
jackshirazi merged 6 commits into
elastic:mainfrom
jackshirazi:stop-sending-option
Dec 18, 2024
Merged

add stop-sending option#474
jackshirazi merged 6 commits into
elastic:mainfrom
jackshirazi:stop-sending-option

Conversation

@jackshirazi

Copy link
Copy Markdown
Contributor

No description provided.

@jackshirazi jackshirazi changed the title add stop-sending option with tests add stop-sending option Dec 6, 2024
Comment thread custom/src/main/java/co/elastic/otel/ElasticLogRecordExporter.java Outdated
Comment thread custom/src/main/java/co/elastic/otel/config/DynamicConfiguration.java Outdated
Comment thread testing-common/src/main/java/co/elastic/otel/testing/OtelReflectionUtils.java Outdated
@jackshirazi
jackshirazi marked this pull request as ready for review December 10, 2024 12:59
@jackshirazi
jackshirazi requested a review from a team December 10, 2024 13:00
Comment thread custom/src/main/java/co/elastic/otel/ElasticLogRecordExporter.java Outdated
Comment thread custom/src/main/java/co/elastic/otel/ElasticLogRecordExporter.java Outdated
Comment thread custom/src/main/java/co/elastic/otel/ElasticLogRecordExporter.java Outdated
private Boolean recoverySendMetricsState;

private boolean initSendingStates() {
if (recoverySendSpansState == null && ElasticSpanExporter.getInstance() != null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we log warning if the exporter instances are null here? This means that the setting might not be correctly respected initially, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good call

@AfterEach
public void endTest() throws InterruptedException {
doRequest(getUrl("/dynamicconfig/reset"), okResponseBody("reset"));
Thread.sleep(500L); // give the reset time to be applied

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for using the smoke-tests instead of an integration-test ?
I prefer the integration tests because they are easier to follow, debug and maintain and still run the full agent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was a reason which is that I prefer the smoke tests and find the integration tests non-transparent in how they work. Though I take your point they are easier to maintain. And these tests are actually integration testst. I've done an initial pass and found a bug the integration test identified that the smoke tests didn't, so I'll map them over

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per discussion (the integration test is unable to handle the exporter wrapping correctly because it has a custom exporter that doesn't go through configuration), staying with the smoke test

Comment thread testing-common/src/main/java/co/elastic/otel/testing/OtelReflectionUtils.java Outdated
Comment thread custom/src/main/java/co/elastic/otel/ElasticLogRecordExporter.java Outdated
@jackshirazi
jackshirazi merged commit dbc12ca into elastic:main Dec 18, 2024
@jackshirazi
jackshirazi deleted the stop-sending-option branch June 3, 2025 11:35
@SylvainJuge SylvainJuge added the enhancement New feature or request label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-java enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants