Skip to content

Commit

Permalink
[receiver/googlecloudspannerreceiver] Rename metadata.yaml to metrics…
Browse files Browse the repository at this point in the history
….yaml (#24011)

**Description:**
While working on #23375, the test looks for all `metadata.yaml` files in
the receiver folder. This `metadata.yaml` file is not the one that is
used for
[mdatagen](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/cmd/mdatagen).
I could use an allowlist to ignore this specific `metadata.yaml`, but it
doesn't seem necessary for it to have the `metadata.yaml` name, so I am
proposing renaming it to `metrics.yaml`.

Co-authored-by: Yang Song <[email protected]>
  • Loading branch information
mackjmr and songy23 committed Jul 18, 2023
1 parent de24d8f commit 7ceba4e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion receiver/googlecloudspannerreceiver/cardinality.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This means that the number of streams that can be sent by OpenTelemetry collecto
For simplicity purpose and for explaining of calculation, which is currently done in implementation, lets assume that we have 1 project, 1 instance and 1 database.
Such calculations are done when the collector starts. If the cardinality total limit is different(for calculations below we assume it is 200,000) the numbers will be different.

According to the metrics [metadata configuration](internal/metadataconfig/metadata.yaml)(at the moment of writing this document) we have:
According to the metrics [metadata configuration](internal/metadataconfig/metrics.yaml)(at the moment of writing this document) we have:
- 30 low cardinality metrics(amount of total N + active queries summary metrics);
- 26 high cardinality metrics(amount of top N metrics).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudspannerreceiver/internal/metadataparser"
)

// Kind of sanity check test of metadata.yaml used for production usage
// Kind of sanity check test of metrics.yaml used for production usage
func TestParsingMetadataYaml(t *testing.T) {
content, err := os.ReadFile("metadata.yaml")
content, err := os.ReadFile("metrics.yaml")

require.NoError(t, err)

Expand Down
2 changes: 1 addition & 1 deletion receiver/googlecloudspannerreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudspannerreceiver/internal/statsreader"
)

//go:embed "internal/metadataconfig/metadata.yaml"
//go:embed "internal/metadataconfig/metrics.yaml"
var metadataYaml []byte

var _ receiver.Metrics = (*googleCloudSpannerReceiver)(nil)
Expand Down

0 comments on commit 7ceba4e

Please sign in to comment.