Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 125 additions & 33 deletions entity-types/infra-mongodb_instance/definition.stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ type: MONGODB_INSTANCE

synthesis:
rules:
- identifier: mongodb.instance.unique_id
name: host.name
- identifier: mongodb.endpoint
name: mongodb.endpoint
encodeIdentifierInGUID: true
conditions:
- attribute: eventType
Expand All @@ -14,53 +14,145 @@ synthesis:
- attribute: instrumentation.provider
value: opentelemetry
- attribute: otel.library.name
anyOf: ["github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver"]
anyOf:
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver
# This filters only metrics coming from mongodbreceiver, given that metrics
# could differ between different runtime receivers.
tags:
otel.library.name:
entityTagName: instrumentation.name
telemetry.sdk.name:
entityTagName: instrumentation.provider

- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_oplog_
tags:
mongodb_cluster_name:

- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_rs_
tags:
mongodb_cluster_name:

- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_ss_
tags:
mongodb_cluster_name:

- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_sys_
tags:
mongodb_cluster_name:

- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_clusterTime_
tags:
mongodb_cluster_name:

- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_electionParticipantMetrics_
tags:
mongodb_cluster_name:

- identifier: entityId
name: entityKey
legacyFeatures:
overrideGuidType: true
- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: MongodSample
value: Metric
- attribute: metricName
prefix: mongodb_electionCandidateMetrics_
tags:
mongodb_cluster_name:
entityTagName: mongodb_cluster_name
mongodb_role:
entityTagName: mongodb_role
clusterName:
entityTagName: clusterName
env:
entityTagName: environment
node:
entityTagName: nodeKey
host:
entityTagName: host
version:
ttl: P1D
uptime:
ttl: P1D
reportingAgent:
ttl: P1D

tags:
telemetry.sdk.name:
entityTagName: instrumentation.provider
- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_heartbeatIntervalMillis
tags:
mongodb_cluster_name:

goldenTags:
- mongodb.instance.unique_id
- server.address
- server.port
- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_members_
tags:
mongodb_cluster_name:

- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_optimes_
tags:
mongodb_cluster_name:

- identifier: mongodb_cluster_name
encodeIdentifierInGUID: true
name: mongodb_cluster_name
conditions:
- attribute: eventType
value: Metric
- attribute: metricName
prefix: mongodb_writeMajorityCount
tags:
mongodb_cluster_name:

dashboardTemplates:
newRelic:
template: dashboard.json
# otel receiver
opentelemetry:
template: opentelemetry_dashboard.stg.json
template: opentelemetry_dashboard.stg.json


configuration:
entityExpirationTime: DAILY
alertable: true
114 changes: 10 additions & 104 deletions entity-types/infra-mongodb_instance/golden_metrics.stg.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,33 @@
database_count:
title: Databases
unit: COUNT
queries:
newRelic:
select: uniqueCount(database) AS 'Databases'
from: MongodSample
eventId: entityGuid
eventName: entityName
# Currently, we don't have a matching function in OTEL having the same name, we can use latest() but the current implementation fails a different function name for the same attribute
# opentelemetry:
# select: latest(`mongodb.database.count`)
# from: Metric
# where: "metricName = 'mongodb.database.count'
query:
select: uniqueCount(database) AS 'Databases'

connections_count:
title: Connections
unit: COUNT
queries:
newRelic:
select: average(mongodb_ss_connections) AS 'Connections'
from: MongodSample
where: conn_type='active'
eventId: entityGuid
eventName: entityName
opentelemetry:
select: average(`mongodb.connection.count`)
from: Metric
where: type='current'
query:
select: average(mongodb_ss_connections) AS 'Connections'
where: conn_type='active'

query_operations_count:
title: Query operations
unit: COUNT
queries:
newRelic:
select: average(mongodb_ss_opcounters) AS 'Query operations'
from: MongodSample
where: legacy_op_type='query'
eventId: entityGuid
eventName: entityName
opentelemetry:
select: average(`mongodb.operation.count`)
from: Metric
where: operation='query'
query:
select: average(mongodb_ss_opcounters) AS 'Query operations'
where: legacy_op_type='query'

document_operations_count:
title: Document operations
unit: COUNT
queries:
newRelic:
select: latest(mongodb_ss_metrics_document) AS 'Document operations'
from: MongodSample
eventId: entityGuid
eventName: entityName
opentelemetry:
select: latest(`mongodb.document.operation.count`)
from: Metric
query:
select: latest(mongodb_ss_metrics_document) AS 'Document operations'

memory_usage:
title: Memory usage
unit: BYTES
queries:
newRelic:
select: average(mongodb_memory_usage)
from: MongodSample
eventId: entityGuid
eventName: entityName
opentelemetry:
select: average(`mongodb.memory.usage`)
from: Metric
Expand All @@ -74,63 +37,6 @@ network_io_receive:
title: Network I/O Received
unit: BYTES
queries:
newRelic:
select: latest(mongodb_network_io_receive)
from: MongodSample
eventId: entityGuid
eventName: entityName
opentelemetry:
select: latest(`mongodb.network.io.receive`)
from: Metric

network_io_transmit:
title: Network I/O Transmitted
unit: BYTES
queries:
newRelic:
select: latest(mongodb_network_io_transmit)
from: MongodSample
eventId: entityGuid
eventName: entityName
opentelemetry:
select: latest(`mongodb.network.io.transmit`)
from: Metric

collection_count:
title: Collections
unit: COUNT
queries:
newRelic:
select: latest(mongodb_collection_count)
from: MongodSample
eventId: entityGuid
eventName: entityName
opentelemetry:
select: latest(`mongodb.collection.count`)
from: Metric

storage_size:
title: Storage Size
unit: BYTES
queries:
newRelic:
select: latest(mongodb_storage_size)
from: MongodSample
eventId: entityGuid
eventName: entityName
opentelemetry:
select: latest(`mongodb.storage.size`)
from: Metric

data_size:
title: Data Size
unit: BYTES
queries:
newRelic:
select: latest(mongodb_data_size)
from: MongodSample
eventId: entityGuid
eventName: entityName
opentelemetry:
select: latest(`mongodb.data.size`)
from: Metric
26 changes: 1 addition & 25 deletions entity-types/infra-mongodb_instance/summary_metrics.stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,4 @@ query_operations_count:
document_operations_count:
goldenMetric: document_operations_count
title: Document operations
unit: COUNT
memory_usage:
goldenMetric: memory_usage
title: Memory usage
unit: BYTES
network_io_receive:
goldenMetric: network_io_receive
title: Network I/O Received
unit: BYTES
network_io_transmit:
goldenMetric: network_io_transmit
title: Network I/O Transmitted
unit: BYTES
collection_count:
goldenMetric: collection_count
title: Collections
unit: COUNT
storage_size:
goldenMetric: storage_size
title: Storage Size
unit: BYTES
data_size:
goldenMetric: data_size
title: Data Size
unit: BYTES
unit: COUNT
Loading