[
https://issues.apache.org/jira/browse/GOBBLIN-2053?focusedWorklogId=916262&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-916262
]
ASF GitHub Bot logged work on GOBBLIN-2053:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 24/Apr/24 21:40
Start Date: 24/Apr/24 21:40
Worklog Time Spent: 10m
Work Description: Will-Lo commented on code in PR #3933:
URL: https://github.com/apache/gobblin/pull/3933#discussion_r1578549856
##########
gobblin-metrics-libs/gobblin-metrics/src/test/java/org/apache/gobblin/metrics/OpenTelemetryMetricsTest.java:
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.metrics;
+
+import java.util.Map;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import org.apache.gobblin.configuration.ConfigurationKeys;
+import org.apache.gobblin.configuration.State;
+
+
+public class OpenTelemetryMetricsTest {
+
+ @Test
+ void testInitializeOpenTelemetryFailsWithoutEndpoint() {
+ State opentelemetryState = new State();
+
opentelemetryState.setProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_ENABLED,
"true");
+ Assert.assertThrows(IllegalArgumentException.class, () -> {
+ OpenTelemetryMetrics.getInstance(opentelemetryState);
+ });
+ }
+
+ @Test
+ void testInitializeOpenTelemetrySucceedsWithEndpoint() {
+ State opentelemetryState = new State();
+
opentelemetryState.setProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_ENABLED,
"true");
+
opentelemetryState.setProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_ENDPOINT,
"http://localhost:4317");
+ OpenTelemetryMetrics metricsProvider =
OpenTelemetryMetrics.getInstance(opentelemetryState);
+ System.out.println(metricsProvider.metricExporter.toString());
Review Comment:
Ah this was leftover code from me trying to discern the internals of the
metrics Provider to see if I can assert on http headers but it's not possible,
will remove it and add a comment to not expect a throw unlike the prior test
Issue Time Tracking
-------------------
Worklog Id: (was: 916262)
Time Spent: 1h (was: 50m)
> 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: 1h
> 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)