[
https://issues.apache.org/jira/browse/GOBBLIN-2053?focusedWorklogId=916269&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-916269
]
ASF GitHub Bot logged work on GOBBLIN-2053:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 24/Apr/24 22:12
Start Date: 24/Apr/24 22:12
Worklog Time Spent: 10m
Work Description: phet commented on code in PR #3933:
URL: https://github.com/apache/gobblin/pull/3933#discussion_r1578581833
##########
gobblin-metrics-libs/gobblin-metrics/src/test/java/org/apache/gobblin/metrics/OpenTelemetryMetricsTest.java:
##########
@@ -38,21 +38,25 @@ void testInitializeOpenTelemetryFailsWithoutEndpoint() {
}
@Test
- void testInitializeOpenTelemetrySucceedsWithEndpoint() {
+ public 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());
+ // Should not throw an exception
+ OpenTelemetryMetrics.getInstance(opentelemetryState);
Review Comment:
since every test should have an assertion, just do an "assert true"
##########
gobblin-metrics-libs/gobblin-metrics/src/test/java/org/apache/gobblin/metrics/OpenTelemetryMetricsTest.java:
##########
@@ -38,21 +38,25 @@ void testInitializeOpenTelemetryFailsWithoutEndpoint() {
}
@Test
- void testInitializeOpenTelemetrySucceedsWithEndpoint() {
+ public 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());
+ // Should not throw an exception
+ OpenTelemetryMetrics.getInstance(opentelemetryState);
}
@Test
- void testHeadersParseCorrectly() {
+ public void testHeadersParseCorrectly() {
Map<String, String> headers = OpenTelemetryMetrics.parseHttpHeaders(
"{\"Content-Type\":\"application/x-protobuf\",\"headerTag\":\"tag1:value1,tag2:value2\"}");
Assert.assertEquals(headers.size(), 2);
Assert.assertEquals(headers.get("Content-Type"), "application/x-protobuf");
Assert.assertEquals(headers.get("headerTag"), "tag1:value1,tag2:value2");
}
-
+ @Test
Review Comment:
newline above
Issue Time Tracking
-------------------
Worklog Id: (was: 916269)
Time Spent: 1.5h (was: 1h 20m)
> 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: 1.5h
> 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)