Skip to content

Commit

Permalink
Remove tags added by DD cluster agent (#10531)
Browse files Browse the repository at this point in the history
Co-authored-by: Jimmy Ma <[email protected]>
  • Loading branch information
jdpgrailsdev and gosusnp committed Dec 26, 2023
1 parent 96a15a3 commit 8a7b7b6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class StatsDRegistryConfigurer : MeterRegistryConfigurer<StatsdMeterRegistry>, O
*/
val tags: MutableSet<String> = LinkedHashSet()

possiblyAddTag(DATA_DOG_ENVIRONMENT_TAG, "env", tags)
possiblyAddTag(DATA_DOG_AGENT_HOST_TAG, "host", tags)
possiblyAddTag(DATA_DOG_SERVICE_TAG, "service", tags)
possiblyAddTag(DATA_DOG_VERSION_TAG, "version", tags)

Expand Down Expand Up @@ -70,8 +68,6 @@ class StatsDRegistryConfigurer : MeterRegistryConfigurer<StatsdMeterRegistry>, O
}

companion object {
const val DATA_DOG_AGENT_HOST_TAG = "DD_AGENT_HOST"
const val DATA_DOG_ENVIRONMENT_TAG = "DD_ENV"
const val DATA_DOG_SERVICE_TAG = "DD_SERVICE"
const val DATA_DOG_VERSION_TAG = "DD_VERSION"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class StatsDRegistryConfigurer : MeterRegistryConfigurer<StatsdMeterRegistry>, O
*/
val tags: MutableSet<String> = LinkedHashSet()

possiblyAddTag(DATA_DOG_ENVIRONMENT_TAG, "env", tags)
possiblyAddTag(DATA_DOG_AGENT_HOST_TAG, "host", tags)
possiblyAddTag(DATA_DOG_SERVICE_TAG, "service", tags)
possiblyAddTag(DATA_DOG_VERSION_TAG, "version", tags)

Expand Down Expand Up @@ -70,8 +68,6 @@ class StatsDRegistryConfigurer : MeterRegistryConfigurer<StatsdMeterRegistry>, O
}

companion object {
const val DATA_DOG_AGENT_HOST_TAG = "DD_AGENT_HOST"
const val DATA_DOG_ENVIRONMENT_TAG = "DD_ENV"
const val DATA_DOG_SERVICE_TAG = "DD_SERVICE"
const val DATA_DOG_VERSION_TAG = "DD_VERSION"
const val DATA_PLANE_ID_TAG = "data_plane_id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,20 @@ import jakarta.inject.Singleton
@Factory
class MeterFilterFactory(
@Value("\${airbyte.data-plane-id}") private val dataplaneId: String,
@Value("\${micronaut.application.name}") private val applicationName: String,
) {
@Bean
@Singleton
fun addCommonTagFilter(): MeterFilter {
// TODO add all the common tags

// Add all the common application-specific tags
val commonTags =
mutableListOf(
Tag.of(DATA_PLANE_ID_TAG, dataplaneId),
Tag.of(DATA_DOG_SERVICE_TAG, applicationName),
)

if (!System.getenv(DATA_DOG_ENVIRONMENT_TAG).isNullOrBlank()) {
commonTags.add(Tag.of(DATA_DOG_ENVIRONMENT_TAG, System.getenv(DATA_DOG_ENVIRONMENT_TAG)))
}

if (!System.getenv(DATA_DOG_AGENT_HOST_TAG).isNullOrBlank()) {
commonTags.add(Tag.of(DATA_DOG_AGENT_HOST_TAG, System.getenv(DATA_DOG_AGENT_HOST_TAG)))
}

if (!System.getenv(DATA_DOG_VERSION_TAG).isNullOrBlank()) {
commonTags.add(Tag.of(DATA_DOG_VERSION_TAG, System.getenv(DATA_DOG_VERSION_TAG)))
}
return MeterFilter.commonTags(commonTags)
}

companion object {
const val DATA_DOG_AGENT_HOST_TAG = "DD_AGENT_HOST"
const val DATA_DOG_ENVIRONMENT_TAG = "DD_ENV"
const val DATA_DOG_SERVICE_TAG = "DD_SERVICE"
const val DATA_DOG_VERSION_TAG = "DD_VERSION"
const val DATA_PLANE_ID_TAG = "data_plane_id"
const val STAGE_NAME_TAG = "stage_name"
const val STATUS_TAG = "status"
Expand Down

0 comments on commit 8a7b7b6

Please sign in to comment.