Skip to content

Commit 2df23c0

Browse files
[receiver/googlecloudpubsubpush] Add telemetry metrics (open-telemetry#44422)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Add telemetry metrics. <!--Describe what testing was performed and which tests were added.--> #### Testing Unit test added. <!--Describe the documentation added.--> #### Documentation Documentation updated. --------- Co-authored-by: Christos Markou <[email protected]>
1 parent f7aba7d commit 2df23c0

File tree

11 files changed

+551
-18
lines changed

11 files changed

+551
-18
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
7+
component: receiver/googlecloudpubsubpush
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add telemetry metrics to the component.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [44422]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)
2+
3+
# googlecloudpubsubpush
4+
5+
## Internal Telemetry
6+
7+
The following telemetry is emitted by this component.
8+
9+
### otelcol_gcp.pubsub.input.uncompressed.size
10+
11+
Size of uncompressed incoming log data in bytes (either direct Pub/Sub message payloads or GCS file content retrieved from event notifications). [Development]
12+
13+
| Unit | Metric Type | Value Type | Stability |
14+
| ---- | ----------- | ---------- | --------- |
15+
| By | Histogram | Double | Development |
16+
17+
#### Attributes
18+
19+
| Name | Description | Values |
20+
| ---- | ----------- | ------ |
21+
| gcp.gcs.bucket.name | Bucket name. | Any Str |
22+
23+
### otelcol_http.server.request.active.count
24+
25+
Number of active requests. [Development]
26+
27+
| Unit | Metric Type | Value Type | Monotonic | Stability |
28+
| ---- | ----------- | ---------- | --------- | --------- |
29+
| {count} | Sum | Int | false | Development |
30+
31+
### otelcol_http.server.request.duration
32+
33+
Duration of requests in seconds. [Development]
34+
35+
| Unit | Metric Type | Value Type | Stability |
36+
| ---- | ----------- | ---------- | --------- |
37+
| s | Histogram | Double | Development |
38+
39+
#### Attributes
40+
41+
| Name | Description | Values |
42+
| ---- | ----------- | ------ |
43+
| http.response.status_code | HTTP response status code. | Any Int |

receiver/googlecloudpubsubpushreceiver/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ func createLogsReceiver(
2727
cfg component.Config,
2828
nextLogs consumer.Logs,
2929
) (receiver.Logs, error) {
30-
return newPubSubPushReceiver(cfg.(*Config), set, nextLogs), nil
30+
return newPubSubPushReceiver(cfg.(*Config), set, nextLogs)
3131
}

receiver/googlecloudpubsubpushreceiver/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ require (
2323
go.opentelemetry.io/collector/pdata v1.46.1-0.20251120204106-2e9c82787618
2424
go.opentelemetry.io/collector/receiver v1.46.1-0.20251120204106-2e9c82787618
2525
go.opentelemetry.io/collector/receiver/receivertest v0.140.1-0.20251120204106-2e9c82787618
26+
go.opentelemetry.io/otel v1.38.0
27+
go.opentelemetry.io/otel/metric v1.38.0
28+
go.opentelemetry.io/otel/sdk/metric v1.38.0
29+
go.opentelemetry.io/otel/trace v1.38.0
2630
go.uber.org/goleak v1.3.0
2731
go.uber.org/zap v1.27.0
2832
)
@@ -87,11 +91,7 @@ require (
8791
go.opentelemetry.io/contrib/detectors/gcp v1.38.0 // indirect
8892
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
8993
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
90-
go.opentelemetry.io/otel v1.38.0 // indirect
91-
go.opentelemetry.io/otel/metric v1.38.0 // indirect
9294
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
93-
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
94-
go.opentelemetry.io/otel/trace v1.38.0 // indirect
9595
go.uber.org/multierr v1.11.0 // indirect
9696
go.yaml.in/yaml/v3 v3.0.4 // indirect
9797
golang.org/x/crypto v0.45.0 // indirect

receiver/googlecloudpubsubpushreceiver/internal/metadata/generated_telemetry.go

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/googlecloudpubsubpushreceiver/internal/metadata/generated_telemetry_test.go

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/googlecloudpubsubpushreceiver/internal/metadatatest/generated_telemetrytest.go

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/googlecloudpubsubpushreceiver/internal/metadatatest/generated_telemetrytest_test.go

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)