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

change trace exporter trasnport protocol from grpc to http/protobuf #66

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"OTEL_SMP_ENABLED": "true",
"OTEL_TRACES_SAMPLER_ARG": "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000",
"OTEL_TRACES_SAMPLER": "xray",
"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces",

Choose a reason for hiding this comment

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

Q: have we tested this endpoint http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces with traces in the current CWAgent?

Copy link
Contributor Author

@wangzlei wangzlei Jan 29, 2024

Choose a reason for hiding this comment

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

From OTel doc, http url v1/traces is for tracs, v1/metrics for metrics and v1/logs for logs.
I verified the Agent http traces endpoint in local by settingOTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces, but haven't verified in operator.

OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces OTEL_METRICS_EXPORTER=none OTEL_SMP_ENABLED=true OTEL_AWS_SMP_EXPORTER_ENDPOINT=http://localhost:4315 java -javaagent:/Users/wangzl/workspace/appsig/aws-otel-java-instrumentation/otelagent/build/libs/aws-opentelemetry-agent-1.32.0-SNAPSHOT.jar -jar ./build/libs/spring-boot-0.0.1-SNAPSHOT.jar Application

Choose a reason for hiding this comment

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

Thanks! I think the local verification should be sufficient.

"OTEL_AWS_SMP_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315",
"OTEL_METRICS_EXPORTER": "none",
"JAVA_TOOL_OPTIONS": "-javaagent:/otel-auto-instrumentation-java/javaagent.jar"
Expand Down
5 changes: 4 additions & 1 deletion pkg/instrumentation/defaultinstrumentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ const (
otelTracesSamplerArgDefaultValue = "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000"
otelTracesSamplerKey = "OTEL_TRACES_SAMPLER"
otelTracesSamplerDefaultValue = "xray"
otelExporterOtlpProtocolKey = "OTEL_EXPORTER_OTLP_PROTOCOL"
otelExporterOtlpProtocolValue = "http/protobuf"
otelExporterTracesEndpointKey = "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"
otelExporterTracesEndpointDefaultValue = "http://cloudwatch-agent.amazon-cloudwatch:4315"
otelExporterTracesEndpointDefaultValue = "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces"
otelExporterSmpEndpointKey = "OTEL_AWS_SMP_EXPORTER_ENDPOINT"
otelExporterSmpEndpointDefaultValue = "http://cloudwatch-agent.amazon-cloudwatch:4315"
otelExporterMetricKey = "OTEL_METRICS_EXPORTER"
Expand Down Expand Up @@ -60,6 +62,7 @@ func getDefaultInstrumentation() (*v1alpha1.Instrumentation, error) {
{Name: otelSampleEnabledKey, Value: otelSampleEnabledDefaultValue},
{Name: otelTracesSamplerArgKey, Value: otelTracesSamplerArgDefaultValue},
{Name: otelTracesSamplerKey, Value: otelTracesSamplerDefaultValue},
{Name: otelExporterOtlpProtocolKey, Value: otelExporterOtlpProtocolValue},
{Name: otelExporterTracesEndpointKey, Value: otelExporterTracesEndpointDefaultValue},
{Name: otelExporterSmpEndpointKey, Value: otelExporterSmpEndpointDefaultValue},
{Name: otelExporterMetricKey, Value: otelExporterMetricDefaultValue},
Expand Down
Loading