Skip to content

Add process name to OTel #4192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 9, 2025
Merged
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
1 change: 1 addition & 0 deletions internal/collector/patroni.go
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ func EnablePatroniLogging(ctx context.Context,
{"action": "insert", "key": "k8s.container.name", "value": naming.ContainerDatabase},
{"action": "insert", "key": "k8s.namespace.name", "value": "${env:K8S_POD_NAMESPACE}"},
{"action": "insert", "key": "k8s.pod.name", "value": "${env:K8S_POD_NAME}"},
{"action": "insert", "key": "process.executable.name", "value": "patroni"},
},
}

6 changes: 6 additions & 0 deletions internal/collector/patroni_test.go
Original file line number Diff line number Diff line change
@@ -65,6 +65,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: patroni
resourcedetection:
detectors: []
override: false
@@ -165,6 +168,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: patroni
resourcedetection:
detectors: []
override: false
1 change: 1 addition & 0 deletions internal/collector/pgadmin.go
Original file line number Diff line number Diff line change
@@ -54,6 +54,7 @@ func EnablePgAdminLogging(ctx context.Context, spec *v1beta1.InstrumentationSpec
{"action": "insert", "key": "k8s.container.name", "value": naming.ContainerPGAdmin},
{"action": "insert", "key": "k8s.namespace.name", "value": "${env:K8S_POD_NAMESPACE}"},
{"action": "insert", "key": "k8s.pod.name", "value": "${env:K8S_POD_NAME}"},
{"action": "insert", "key": "process.executable.name", "value": "pgadmin"},
},
}

6 changes: 6 additions & 0 deletions internal/collector/pgadmin_test.go
Original file line number Diff line number Diff line change
@@ -69,6 +69,9 @@ collector.yaml: |
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: pgadmin
resourcedetection:
detectors: []
override: false
@@ -194,6 +197,9 @@ collector.yaml: |
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: pgadmin
resourcedetection:
detectors: []
override: false
1 change: 1 addition & 0 deletions internal/collector/pgbackrest.go
Original file line number Diff line number Diff line change
@@ -87,6 +87,7 @@ func NewConfigForPgBackrestRepoHostPod(
{"action": "insert", "key": "k8s.container.name", "value": naming.PGBackRestRepoContainerName},
{"action": "insert", "key": "k8s.namespace.name", "value": "${env:K8S_POD_NAMESPACE}"},
{"action": "insert", "key": "k8s.pod.name", "value": "${env:K8S_POD_NAME}"},
{"action": "insert", "key": "process.executable.name", "value": "pgbackrest"},
},
}

6 changes: 6 additions & 0 deletions internal/collector/pgbackrest_test.go
Original file line number Diff line number Diff line change
@@ -67,6 +67,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: pgbackrest
resourcedetection:
detectors: []
override: false
@@ -174,6 +177,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: pgbackrest
resourcedetection:
detectors: []
override: false
1 change: 1 addition & 0 deletions internal/collector/pgbouncer.go
Original file line number Diff line number Diff line change
@@ -90,6 +90,7 @@ func EnablePgBouncerLogging(ctx context.Context,
{"action": "insert", "key": "k8s.container.name", "value": naming.ContainerPGBouncer},
{"action": "insert", "key": "k8s.namespace.name", "value": "${env:K8S_POD_NAMESPACE}"},
{"action": "insert", "key": "k8s.pod.name", "value": "${env:K8S_POD_NAME}"},
{"action": "insert", "key": "process.executable.name", "value": "pgbouncer"},
},
}

6 changes: 6 additions & 0 deletions internal/collector/pgbouncer_test.go
Original file line number Diff line number Diff line change
@@ -64,6 +64,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: pgbouncer
resourcedetection:
detectors: []
override: false
@@ -164,6 +167,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: pgbouncer
resourcedetection:
detectors: []
override: false
2 changes: 2 additions & 0 deletions internal/collector/postgres.go
Original file line number Diff line number Diff line change
@@ -197,6 +197,7 @@ func EnablePostgresLogging(
{"action": "insert", "key": "k8s.container.name", "value": naming.ContainerDatabase},
{"action": "insert", "key": "k8s.namespace.name", "value": "${env:K8S_POD_NAMESPACE}"},
{"action": "insert", "key": "k8s.pod.name", "value": "${env:K8S_POD_NAME}"},
{"action": "insert", "key": "process.executable.name", "value": "postgres"},

// https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/database#readme
{"action": "insert", "key": "db.system", "value": "postgresql"},
@@ -276,6 +277,7 @@ func EnablePostgresLogging(
{"action": "insert", "key": "k8s.container.name", "value": naming.ContainerDatabase},
{"action": "insert", "key": "k8s.namespace.name", "value": "${env:K8S_POD_NAMESPACE}"},
{"action": "insert", "key": "k8s.pod.name", "value": "${env:K8S_POD_NAME}"},
{"action": "insert", "key": "process.executable.name", "value": "pgbackrest"},
},
}

12 changes: 12 additions & 0 deletions internal/collector/postgres_test.go
Original file line number Diff line number Diff line change
@@ -73,6 +73,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: pgbackrest
resource/postgres:
attributes:
- action: insert
@@ -84,6 +87,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: postgres
- action: insert
key: db.system
value: postgresql
@@ -333,6 +339,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: pgbackrest
resource/postgres:
attributes:
- action: insert
@@ -344,6 +353,9 @@ processors:
- action: insert
key: k8s.pod.name
value: ${env:K8S_POD_NAME}
- action: insert
key: process.executable.name
value: postgres
- action: insert
key: db.system
value: postgresql