-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ioredis and redis DB semantic conventions (#167)
* fix: add required node types dev dependency Signed-off-by: Naseem <[email protected]> * fix: conform to semantic conventions Signed-off-by: Naseem <[email protected]>
- Loading branch information
Naseem
authored
Aug 13, 2020
1 parent
5be5217
commit 674b384
Showing
10 changed files
with
59 additions
and
112 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -26,7 +26,10 @@ import { | |
import * as assert from 'assert'; | ||
import * as redisTypes from 'redis'; | ||
import { plugin, RedisPlugin } from '../src'; | ||
import { AttributeNames } from '../src/enums'; | ||
import { | ||
DatabaseAttribute, | ||
GeneralAttribute, | ||
} from '@opentelemetry/semantic-conventions'; | ||
|
||
const memoryExporter = new InMemorySpanExporter(); | ||
|
||
|
@@ -38,10 +41,10 @@ const CONFIG = { | |
const URL = `redis://${CONFIG.host}:${CONFIG.port}`; | ||
|
||
const DEFAULT_ATTRIBUTES = { | ||
[AttributeNames.COMPONENT]: RedisPlugin.COMPONENT, | ||
[AttributeNames.PEER_HOSTNAME]: CONFIG.host, | ||
[AttributeNames.PEER_PORT]: CONFIG.port, | ||
[AttributeNames.PEER_ADDRESS]: URL, | ||
[DatabaseAttribute.DB_SYSTEM]: RedisPlugin.COMPONENT, | ||
[GeneralAttribute.NET_PEER_HOSTNAME]: CONFIG.host, | ||
[GeneralAttribute.NET_PEER_PORT]: CONFIG.port, | ||
[GeneralAttribute.NET_PEER_ADDRESS]: URL, | ||
}; | ||
|
||
const okStatus: Status = { | ||
|
@@ -172,7 +175,7 @@ describe('[email protected]', () => { | |
it(`should create a child span for ${operation.description}`, done => { | ||
const attributes = { | ||
...DEFAULT_ATTRIBUTES, | ||
[AttributeNames.DB_STATEMENT]: operation.command, | ||
[DatabaseAttribute.DB_STATEMENT]: operation.command, | ||
}; | ||
const span = tracer.startSpan('test span'); | ||
tracer.withSpan(span, () => { | ||
|