Skip to content

Commit

Permalink
Update collector examples to use otlphttp exporter (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg authored Jan 19, 2024
1 parent db6a6f6 commit c78fc53
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 24 deletions.
6 changes: 3 additions & 3 deletions other-examples/collector/confluentcloud/collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ receivers:
"resource.kafka.id":
- $CLUSTER_ID
exporters:
otlp:
otlphttp:
endpoint: $NEW_RELIC_OTLP_ENDPOINT
headers:
api-key: $NEW_RELIC_API_KEY
Expand All @@ -48,8 +48,8 @@ service:
metrics:
receivers: [prometheus]
processors: [batch]
exporters: [otlp]
exporters: [otlphttp]
metrics/kafka:
receivers: [kafkametrics]
processors: [batch]
exporters: [otlp]
exporters: [otlphttp]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.6"
services:

otel-collector:
image: otel/opentelemetry-collector-contrib:latest
image: otel/opentelemetry-collector-contrib:0.92.0
command: --config=/etc/otelcol/config.yaml
volumes:
- ./collector.yaml:/etc/otelcol/config.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ The collector is configured with the following components.
* The [Transform processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor). This processor is configured to truncate attributes on spans and logs to adhere to New Relic's attribute length limits. Attributes over the limit will cause data to be dropped. Note that the transform processor has not been configured to truncate attributes on metrics. Long metric attributes should be unusual. Truncating metric attributes can be complex and may require metrics to be reaggregated. The transform processor does not perform any reaggregation.

### Exporters
* The [OTLP gRPC exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlpexporter). This exporter is configured to send data to New Relic. See [documentation](https://docs.newrelic.com/docs/integrations/open-source-telemetry-integrations/opentelemetry/introduction-opentelemetry-new-relic/#how-it-works) for more information about New Relic OTLP support.
* The [OTLP HTTP exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter). This exporter is configured to send data to New Relic. See [documentation](https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/get-started/opentelemetry-set-up-your-app/) for more information about New Relic OTLP support.
* The [Logging exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/loggingexporter). This exporter logs data the collector processes to standard out. It can be useful for troubleshooting.
2 changes: 1 addition & 1 deletion other-examples/collector/nr-config/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
collector:
image: otel/opentelemetry-collector-contrib:0.80.0
image: otel/opentelemetry-collector-contrib:0.92.0
volumes:
- ./otel-config.yaml:/otel-config.yaml
command: ["--config=/otel-config.yaml", "${OTELCOL_ARGS}"]
Expand Down
13 changes: 7 additions & 6 deletions other-examples/collector/nr-config/otel-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ receivers:
otlp:
protocols:
grpc:
http:
fluentforward:
endpoint: 0.0.0.0:8006
processors:
Expand All @@ -24,22 +25,22 @@ processors:
exporters:
logging:
verbosity: $LOG_EXPORTER_LOG_VERBOSITY
otlp:
endpoint: https://otlp.nr-data.net:4317
otlphttp:
endpoint: https://otlp.nr-data.net
headers:
"api-key": $NEW_RELIC_API_KEY
api-key: $NEW_RELIC_API_KEY
service:
extensions: [health_check]
pipelines:
metrics:
receivers: [otlp]
processors: [cumulativetodelta, batch]
exporters: [logging, otlp]
exporters: [logging, otlphttp]
traces:
receivers: [otlp]
processors: [transform, batch]
exporters: [logging, otlp]
exporters: [logging, otlphttp]
logs:
receivers: [otlp, fluentforward]
processors: [transform, batch]
exporters: [logging, otlp]
exporters: [logging, otlphttp]
2 changes: 1 addition & 1 deletion other-examples/java/logs-in-context-log4j2/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NEW_RELIC_OTLP_ENDPOINT=https://otlp.nr-data.net:4317
NEW_RELIC_OTLP_ENDPOINT=https://otlp.nr-data.net
NEW_RELIC_API_KEY=
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- collector

collector:
image: otel/opentelemetry-collector-contrib:0.83.0
image: otel/opentelemetry-collector-contrib:0.92.0
volumes:
- ./otel-config.yaml:/otel-config.yaml
command: ["--config=/otel-config.yaml"]
Expand All @@ -30,6 +30,7 @@ services:
NEW_RELIC_API_KEY: '${NEW_RELIC_API_KEY}'
ports:
- '4317:4317' # OTLP gRPC receiver
- '4318:4318' # OTLP HTTP receiver
- '13133:13133' # health_check
- '8006:8006' # Fluentd forward receiver
- '8006:8006/udp' # Fluentd forward receiver
11 changes: 6 additions & 5 deletions other-examples/java/logs-in-context-log4j2/otel-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ receivers:
otlp:
protocols:
grpc:
http:
fluentforward:
endpoint: 0.0.0.0:8006
processors:
Expand All @@ -21,22 +22,22 @@ processors:
exporters:
logging:
verbosity: $LOG_EXPORTER_LOG_VERBOSITY
otlp:
otlphttp:
endpoint: $NEW_RELIC_OTLP_ENDPOINT
headers:
"api-key": $NEW_RELIC_API_KEY
api-key: $NEW_RELIC_API_KEY
service:
extensions: [health_check]
pipelines:
metrics:
receivers: [otlp]
processors: [batch]
exporters: [ otlp]
exporters: [ otlphttp]
traces:
receivers: [otlp]
processors: [ batch ]
exporters: [ logging, otlp]
exporters: [ logging, otlphttp]
logs:
receivers: [fluentforward]
processors: [ transform, batch ]
exporters: [logging, otlp]
exporters: [logging, otlphttp]
8 changes: 4 additions & 4 deletions other-examples/serverless/aws-lambda/java/collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exporters:
loglevel: debug
sampling_initial: 5
sampling_thereafter: 200
otlp:
otlphttp:
endpoint: ${NEW_RELIC_OPENTELEMETRY_ENDPOINT}
headers:
api-key: ${NEW_RELIC_LICENSE_KEY}
Expand All @@ -21,11 +21,11 @@ service:
pipelines:
traces:
receivers: [otlp]
exporters: [logging,otlp]
exporters: [logging,otlphttp]
metrics:
receivers: [otlp]
exporters: [logging,otlp]
exporters: [logging,otlphttp]
logs:
receivers: [otlp]
processors: []
exporters: [logging,otlp]
exporters: [logging,otlphttp]
2 changes: 1 addition & 1 deletion other-examples/serverless/aws-lambda/java/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Parameters:
newRelicEndpoint:
Type: String
Description: New Relic OpenTelemetry endpoint to use.
Default: otlp.nr-data.net:4317
Default: https://otlp.nr-data.net

Resources:
api:
Expand Down

0 comments on commit c78fc53

Please sign in to comment.