[
https://issues.apache.org/jira/browse/GOBBLIN-2053?focusedWorklogId=916248&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-916248
]
ASF GitHub Bot logged work on GOBBLIN-2053:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 24/Apr/24 19:55
Start Date: 24/Apr/24 19:55
Worklog Time Spent: 10m
Work Description: phet commented on code in PR #3933:
URL: https://github.com/apache/gobblin/pull/3933#discussion_r1578437228
##########
gobblin-metrics-libs/gobblin-metrics/src/main/java/org/apache/gobblin/metrics/OpenTelemetryMetrics.java:
##########
@@ -60,9 +63,12 @@ protected MetricExporter initializeMetricExporter(State
state) {
"OpenTelemetry endpoint must be provided");
OtlpHttpMetricExporterBuilder httpExporterBuilder =
OtlpHttpMetricExporter.builder();
httpExporterBuilder.setEndpoint(state.getProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_ENDPOINT));
- if
(state.contains(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_HEADER_KEY)
&&
state.contains(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_HEADER_VALUE))
{
-
httpExporterBuilder.addHeader(state.getProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_HEADER_KEY),
-
state.getProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_HEADER_VALUE));
+
+ if
(state.contains(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_HEADERS)) {
+ Map<String, String> headers =
parseHttpHeaders(state.getProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_HEADERS));
Review Comment:
looks like this might not safely handle `null`, no?
e.g.:
```
Optional.ofNullable(state.getProp(...)).ifPresent(headersMap ->
headersMap.entrySet().forEach(header ->
heb.addHeader(...)
));
```
Issue Time Tracking
-------------------
Worklog Id: (was: 916248)
Time Spent: 20m (was: 10m)
> Fix config setup to Opentelemetry metric emitter
> ------------------------------------------------
>
> Key: GOBBLIN-2053
> URL: https://issues.apache.org/jira/browse/GOBBLIN-2053
> Project: Apache Gobblin
> Issue Type: Improvement
> Reporter: William Lo
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Opentelemetry event submitter which is used in GaaS was not propagating
> certain tags and attributes correctly to connect to external sources.
> We want to do the following:
> 1. Add some logging when the emitter is initialized successfully
> 2. Enforce a URL if it is enabled so that it can emit to an endpoint (not
> localhost)
> 3. Allow the user to specify headers in JSON format for forwarding metrics to
> a metrics aggregator (e.g. Fluentbit)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)