-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: initialize metrics client for connector builder server (#14872)
- Loading branch information
1 parent
7f580c8
commit d75be47
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...builder-server/src/main/java/io/airbyte/connector_builder/config/MetricClientFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2020-2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.connector_builder.config; | ||
|
||
import io.airbyte.metrics.lib.MetricClient; | ||
import io.airbyte.metrics.lib.MetricEmittingApps; | ||
import io.micronaut.context.annotation.Factory; | ||
import io.micronaut.context.annotation.Replaces; | ||
import jakarta.inject.Singleton; | ||
|
||
/** | ||
* Micronaut singleton factory for the creation and initialization of the {@link MetricClient}. | ||
*/ | ||
@Factory | ||
public class MetricClientFactory { | ||
|
||
/** | ||
* Creates and initializes the {@link MetricClient}. | ||
* | ||
* @return The initialized {@link MetricClient}. | ||
*/ | ||
@Singleton | ||
@Replaces(MetricClient.class) | ||
public MetricClient metricClient() { | ||
// Initialize the metric client | ||
io.airbyte.metrics.lib.MetricClientFactory.initialize(MetricEmittingApps.CONNECTOR_BUILDER_SERVER); | ||
return io.airbyte.metrics.lib.MetricClientFactory.getMetricClient(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters