Skip to content

Commit d8ad3a8

Browse files
authored
Added Native APM to OTEL MSSQL Relationship (#2593)
* Added Native APM to OTEL MSSQL Relationship * updated entity relationship names
1 parent e40dc9c commit d8ad3a8

3 files changed

Lines changed: 168 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
domain: INFRA
2+
type: MSSQLINSTANCE
3+
4+
synthesis:
5+
rules:
6+
- ruleName: infra_mssqlinstance_entityId
7+
identifier: entityId
8+
name: entityName
9+
legacyFeatures:
10+
useNonStandardAttributes: true
11+
overrideGuidType: true
12+
prefixedTags:
13+
label.:
14+
ttl: PT4H
15+
conditions:
16+
- attribute: event_type
17+
value: "MssqlInstanceSample"
18+
tags:
19+
integrationName:
20+
ttl: P1D
21+
integrationVersion:
22+
ttl: P1D
23+
reportingAgent:
24+
ttl: P1D
25+
entityKey:
26+
ttl: P1D
27+
28+
- ruleName: infra_mssqlinstance_server_address
29+
identifier: server.address
30+
name: server.address
31+
encodeIdentifierInGUID: true
32+
conditions:
33+
- attribute: eventType
34+
value: Metric
35+
- attribute: metricName
36+
prefix: sqlserver.
37+
- attribute: instrumentation.provider
38+
value: opentelemetry
39+
- attribute: otel.library.name
40+
value: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/newrelicsqlserverreceiver
41+
tags:
42+
otel.library.name:
43+
entityTagName: instrumentation.name
44+
telemetry.sdk.name:
45+
entityTagName: instrumentation.provider
46+
server.address:
47+
entityTagName: server.address
48+
server.port:
49+
entityTagName: server.port
50+
sql.version:
51+
entityTagName: database.version
52+
db.hostname:
53+
entityTagName: db.hostname
54+
goldenTags:
55+
- mssql.host
56+
- mssql.instance
57+
configuration:
58+
entityExpirationTime: DAILY
59+
alertable: true
60+
61+
dashboardTemplates:
62+
# This should match the entity created from the ohi in the infra pipeline
63+
newRelic:
64+
template: newrelic_dashboard.json
65+
opentelemetry:
66+
template: newrelic_otel_sql_dashboard.json
67+
68+
ownership:
69+
primaryOwner:
70+
teamName: "Database Integrations"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
category: MSSQLINSTANCE
2+
lookups:
3+
- entityTypes:
4+
- domain: INFRA
5+
type: MSSQLINSTANCE
6+
tags:
7+
matchingMode: ALL
8+
predicates:
9+
- tagKeys: ["server.address"]
10+
field: serverAddress
11+
- tagKeys: ["server.port"]
12+
field: serverPort
13+
onMatch:
14+
onMultipleMatches: RELATE_ALL
15+
onMiss:
16+
action: NO_OP
17+
- entityTypes:
18+
- domain: INFRA
19+
type: MSSQLINSTANCE
20+
tags:
21+
matchingMode: ALL
22+
predicates:
23+
- tagKeys: ["host.name"]
24+
field: hostName
25+
onMatch:
26+
onMultipleMatches: RELATE_ALL
27+
onMiss:
28+
action: NO_OP
29+
- entityTypes:
30+
- domain: INFRA
31+
type: MSSQLINSTANCE
32+
tags:
33+
matchingMode: ALL
34+
predicates:
35+
- tagKeys: ["db.hostname"]
36+
field: dbHostname
37+
- tagKeys: ["server.port"]
38+
field: serverPort
39+
onMatch:
40+
onMultipleMatches: RELATE_ALL
41+
onMiss:
42+
action: NO_OP
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
relationships:
2+
- name: apmApplicationCallsInfraMSSQLInstanceStaging
3+
version: "1"
4+
origins:
5+
- APM Metrics
6+
conditions:
7+
- attribute: metricName
8+
# "datastore/instance/MSSQL/$host/$port"
9+
startsWith: "datastore/instance/MSSQL/"
10+
relationship:
11+
expires: PT75M
12+
relationshipType: CALLS
13+
source:
14+
extractGuid:
15+
attribute: entity.guid
16+
target:
17+
buildGuid:
18+
account:
19+
lookup: true
20+
domain:
21+
value: INFRA
22+
type:
23+
value: MSSQLINSTANCE
24+
valueInGuid: NA
25+
identifier:
26+
fragments:
27+
- value: "ms-instance:"
28+
- attribute: metricName__4 # hostname
29+
- value: ":instance="
30+
# This rule assumes that the instance name is equal to the db hostname in lower case.
31+
- attribute: metricName__4 # hostname in lowerCase
32+
operations:
33+
- operation: toLowerCase
34+
hashAlgorithm: FARM_HASH
35+
36+
- name: apmApplicationCallsInfraMSSQLInstanceTimesliceStaging
37+
version: "1"
38+
origins:
39+
- APM Metrics
40+
conditions:
41+
- attribute: metricName
42+
regex: "^[Dd]atastore/instance/MSSQL/[^/]+/[0-9]+"
43+
relationship:
44+
expires: PT75M
45+
relationshipType: CALLS
46+
source:
47+
extractGuid:
48+
attribute: entity.guid
49+
target:
50+
lookupGuid:
51+
candidateCategory: MSSQLINSTANCE
52+
fields:
53+
- field: dbHostname
54+
attribute: metricName__4
55+
- field: serverPort
56+
attribute: metricName__5

0 commit comments

Comments
 (0)