Skip to content

Commit d96b04b

Browse files
committed
Remove un-needed attributes
1 parent 41fbbaa commit d96b04b

File tree

2 files changed

+9
-37
lines changed

2 files changed

+9
-37
lines changed

instrumentation/opentelemetry-instrumentation-arangodb/src/opentelemetry/instrumentation/arangodb/__init__.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -140,30 +140,10 @@ def _get_request_attributes(
140140
attributes[arangodb_attributes.ALLOW_DIRTY_READS] = (
141141
options.get("allowDirtyReads")
142142
)
143-
if "allowRetry" in options:
144-
attributes[arangodb_attributes.ALLOW_RETRY] = options.get(
145-
"allowRetry"
146-
)
147143
if "cache" in options:
148144
attributes[arangodb_attributes.CACHE] = options.get("cache")
149-
if "failOnWarning" in options:
150-
attributes[arangodb_attributes.FAIL_ON_WARNING] = options.get(
151-
"failOnWarning"
152-
)
153-
if "fullCount" in options:
154-
attributes[arangodb_attributes.FULL_COUNT] = options.get(
155-
"fullCount"
156-
)
157-
if "maxRuntime" in options:
158-
attributes[arangodb_attributes.MAX_RUNTIME] = options.get(
159-
"maxRuntime"
160-
)
161145
if "stream" in options:
162146
attributes[arangodb_attributes.STREAM] = options.get("stream")
163-
if "usePlanCache" in options:
164-
attributes[arangodb_attributes.USE_PLAN_CACHE] = options.get(
165-
"usePlanCache"
166-
)
167147

168148
return span_name, attributes
169149

@@ -173,14 +153,12 @@ def _get_response_attributes(self, response: Response) -> dict[str, Any]:
173153
}
174154

175155
if "cached" in response.body:
176-
attributes["arangodb.response.cached"] = response.body.get(
177-
"cached"
156+
attributes[arangodb_attributes.RESPONSE_CACHED] = (
157+
response.body.get("cached")
178158
)
179159
if "count" in response.body:
180-
attributes["arangodb.response.count"] = response.body.get("count")
181-
if "hasMore" in response.body:
182-
attributes["arangodb.response.hasMore"] = response.body.get(
183-
"hasMore"
160+
attributes[arangodb_attributes.RESPONSE_COUNT] = response.body.get(
161+
"count"
184162
)
185163

186164
return attributes
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
ALLOW_DIRTY_READS = "arangodb.options.allowDirtyReads"
1+
QUERY_ALLOW_DIRTY_READS = "arangodb.query.allowDirtyReads"
22

3-
ALLOW_RETRY = "arangodb.options.allowRetry"
3+
QUERY_CACHE = "arangodb.query.cache"
44

5-
CACHE = "arangodb.options.cache"
5+
QUERY_STREAM = "arangodb.query.stream"
66

7-
FAIL_ON_WARNING = "arangodb.options.failOnWarning"
7+
RESPONSE_CACHED = "arangodb.response.cached"
88

9-
FULL_COUNT = "arangodb.options.fullCount"
10-
11-
MAX_RUNTIME = "arangodb.options.maxRuntime"
12-
13-
STREAM = "arangodb.options.stream"
14-
15-
USE_PLAN_CACHE = "arangodb.options.usePlanCache"
9+
RESPONSE_COUNT = "arangodb.response.count"

0 commit comments

Comments
 (0)