Skip to content

Commit

Permalink
Fix db_name taggin on Neo4j v4 (DataDog#2314)
Browse files Browse the repository at this point in the history
* Fix db_name taggin on Neo4j v4
  • Loading branch information
ian28223 authored Apr 5, 2024
1 parent d120171 commit 89a5206
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 38 deletions.
6 changes: 6 additions & 0 deletions neo4j/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG - neo4j

## 3.0.3 / 2024-04-05

***Fixed***:

* Fixes db_name tagging regression introduced by 00830c1 - PR [2314](https://github.com/DataDog/integrations-extras/pull/2314)

## 3.0.2 / 2023-10-31

***Changed***:
Expand Down
2 changes: 1 addition & 1 deletion neo4j/datadog_checks/neo4j/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.0.2'
__version__ = "3.0.3"
4 changes: 3 additions & 1 deletion neo4j/datadog_checks/neo4j/neo4j.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from packaging import version

from datadog_checks.base import OpenMetricsBaseCheckV2
from datadog_checks.base.checks.openmetrics.v2.transform import NATIVE_TRANSFORMERS

Expand Down Expand Up @@ -44,7 +46,7 @@ def custom_transformer(metric, sample_data, runtime_data):
else:
db_name = GLOBAL_DB_NAME
final_metric_name = metric_name
if self.config.neo4j_dbs and self.config.neo4j_version.startswith('5.'):
if self.config.neo4j_dbs and version.parse(self.config.neo4j_version) >= version.parse("4.3"):
if metric.name.startswith('neo4j_'):
raw_metric_name = metric.name.replace('neo4j_', '', 1)
else:
Expand Down
4 changes: 2 additions & 2 deletions neo4j/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ version = ["4.4","5.x"]

[envs.default.overrides]
matrix.version.env-vars = [
{ key = "NEO4J_IMAGE", value = "neo4j:4.4.18-enterprise", if = ["4.4"] },
{ key = "NEO4J_IMAGE", value = "neo4j:enterprise", if = ["5.x"] },
{ key = "NEO4J_IMAGE", value = "4.4", if = ["4.4"] },
{ key = "NEO4J_IMAGE", value = "5.17", if = ["5.x"] },
]

[envs.default]
Expand Down
16 changes: 0 additions & 16 deletions neo4j/tests/docker/docker-compose_v4.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions neo4j/tests/docker/docker-compose_v5.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion neo4j/tests/docker/neo4j4/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
neo4j:
image: neo4j:4.4.18-enterprise
image: neo4j:4.4-enterprise
ports:
- 2004:2004
environment:
Expand Down
2 changes: 1 addition & 1 deletion neo4j/tests/docker/neo4j5/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
neo4j:
image: neo4j:enterprise
image: neo4j:5.17-enterprise
ports:
- 2004:2004
environment:
Expand Down

0 comments on commit 89a5206

Please sign in to comment.