Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting otlp protocol for profiler with otel.exporter.otlp.protocol #2090

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

laurit
Copy link
Collaborator

@laurit laurit commented Oct 16, 2024

Use otel.exporter.otlp.protocol when splunk.profiler.otlp.protocol is not set.

@laurit laurit requested review from a team as code owners October 16, 2024 10:14
Comment on lines +119 to +121
return config.getString(
CONFIG_KEY_PROFILER_OTLP_PROTOCOL,
config.getString(CONFIG_KEY_OTLP_PROTOCOL, "http/protobuf"));
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻

@@ -82,7 +83,6 @@ Map<String, String> defaultProperties() {
config.put(CONFIG_KEY_MEMORY_ENABLED, String.valueOf(DEFAULT_MEMORY_ENABLED));
config.put(CONFIG_KEY_MEMORY_EVENT_RATE, DEFAULT_MEMORY_EVENT_RATE);
config.put(CONFIG_KEY_CALL_STACK_INTERVAL, DEFAULT_CALL_STACK_INTERVAL.toMillis() + "ms");
config.put(CONFIG_KEY_OTLP_PROTOCOL, "http/protobuf");
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes it a little more challenging for a casual reader to know the default, but I think it's fine.

void getOtlpProtocolDefault() {
String result =
Configuration.getOtlpProtocol(DefaultConfigProperties.create(Collections.emptyMap()));
assertEquals(result, "http/protobuf");

Choose a reason for hiding this comment

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

Order of arguments should be reversed. Currently assertion error message may be misleading if the assertion fails.
The same applies to all assetEquals calls in this file.
Maybe using assertThat(result).isEqualTo("http/protobuf"); would be little bit more verbose, but on the other hand not confusing.

@laurit laurit merged commit 03e05ce into signalfx:main Oct 17, 2024
25 checks passed
@laurit laurit deleted the profiler-otlp-protocol branch October 17, 2024 14:34
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants