Skip to content
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

Add option to restore high cardinality for metrics for HTTP server #7429

Merged
merged 28 commits into from Feb 6, 2024

Conversation

ItalyPaleAle
Copy link
Contributor

This is configured using the Configuration CRD. High cardinality is enabled by default in Dapr 1.13, but shows a warning. The default behavior will be changed in 1.14.

Fixes #7295

This is configured using the Configuration CRD. High cardinality is enabled by default in Dapr 1.13, but shows a warning. The default behavior will be changed in 1.14.

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
@ItalyPaleAle ItalyPaleAle requested review from a team as code owners January 23, 2024 00:26
@dapr-bot

This comment was marked as outdated.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 59 lines in your changes are missing coverage. Please review.

Comparison is base (afe79bc) 62.19% compared to head (5d5eaaf) 62.11%.

Files Patch % Lines
pkg/diagnostics/http_monitoring.go 31.42% 41 Missing and 7 partials ⚠️
pkg/config/configuration.go 66.66% 2 Missing and 2 partials ⚠️
pkg/runtime/config.go 0.00% 3 Missing ⚠️
pkg/diagnostics/http_monitoring_legacy.go 94.11% 1 Missing and 1 partial ⚠️
pkg/channel/http/http_channel.go 75.00% 1 Missing ⚠️
pkg/diagnostics/metrics.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7429      +/-   ##
==========================================
- Coverage   62.19%   62.11%   -0.08%     
==========================================
  Files         244      245       +1     
  Lines       22297    22346      +49     
==========================================
+ Hits        13867    13880      +13     
- Misses       7281     7306      +25     
- Partials     1149     1160      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ItalyPaleAle ItalyPaleAle marked this pull request as draft January 23, 2024 01:26
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
@msfussell
Copy link
Member

Before merging this issue, please create a docs PR to update the following

  1. https://docs.dapr.io/operations/configuration/configuration-overview/
  2. https://docs.dapr.io/reference/resource-specs/configuration-schema/

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
@ItalyPaleAle ItalyPaleAle marked this pull request as ready for review January 23, 2024 18:44
@dapr-bot

This comment was marked as outdated.

ItalyPaleAle and others added 2 commits January 23, 2024 20:15
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
the HTTP server
properties:
increasedCardinality:
description: 'If false, metrics for the HTTP server are collected
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick
If true,

the HTTP server
properties:
increasedCardinality:
description: 'If false, metrics for the HTTP server are collected
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same nitpick

@mukundansundar
Copy link
Contributor

/ok-to-test

@mukundansundar
Copy link
Contributor

/test-version-skew

@dapr-bot

This comment was marked as outdated.

@dapr-bot

This comment was marked as outdated.

@dapr-bot

This comment was marked as outdated.

@dapr-bot

This comment was marked as outdated.

@dapr-bot

This comment was marked as outdated.

Copy link
Contributor

@JoshVanL JoshVanL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments from me :)

type MetricHTTP struct {
// If false, metrics for the HTTP server are collected with increased cardinality.
// The default is true in Dapr 1.13, but will be changed to false in 1.14+
// TODO @ItalyPaleAle: Metrics cardinality
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intended to be committed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is so I can search "TODO @ItalyPaleAle" in the codebase :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the text to be more explicit

pkg/config/configuration.go Outdated Show resolved Hide resolved
pkg/diagnostics/http_monitoring.go Show resolved Hide resolved
Comment on lines +39 to +44
type base struct {
daprd *procdaprd.Daprd
httpClient *http.Client
grpcClient runtimev1pb.DaprClient
grpcConn *grpc.ClientConn
place *placement.Placement
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a fan of having a "base" suite test case as it obfuscates what is being setup/run to the reader. We should be over explicit in tests.

Can we move the base code into its consumed test cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can but then the code would be replicated multiple times and be harder to maintain

@@ -0,0 +1,97 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving both http tests into a http directory. This improves test organisation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't if using the base class, which is for DRY

spec:
metrics:
http:
increasedCardinality: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also have a test for when this value is nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test to pkg/config/configuration_test.go since the value will change in the future and the test is duplicate.

tests/integration/suite/daprd/metrics/workflow.go Outdated Show resolved Hide resolved
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
…cs-cardinality

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
@ItalyPaleAle
Copy link
Contributor Author

/test-version-skew

@ItalyPaleAle
Copy link
Contributor Author

/ok-to-test

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 29, 2024

Dapr Version Skew integration test (dapr-sidecar-master - 1.12.4)

🔗 Link to Action run

Commit ref: 25cfa96

✅ Version Skew tests passed

yaron2
yaron2 previously approved these changes Jan 29, 2024
@ItalyPaleAle ItalyPaleAle added the autoupdate DaprBot will keep the Pull Request up to date with master branch label Jan 30, 2024
…cs-cardinality

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
@artursouza
Copy link
Member

I am OK to merge this PR but need the MacOS integration tests to pass.

@artursouza
Copy link
Member

This PR is adding flakiness to integration tests or a bug: https://github.com/dapr/dapr/actions/runs/7716239633?pr=7429

@ItalyPaleAle
Copy link
Contributor Author

This PR is adding flakiness to integration tests or a bug: https://github.com/dapr/dapr/actions/runs/7716239633?pr=7429

Those are the same errors we have in master

@artursouza
Copy link
Member

Will fix flakiness in master and re-assess this PR. We need to fix both issues to release anyway.

@artursouza artursouza dismissed JoshVanL’s stale review February 6, 2024 05:01

Yaron and I decided not to block this PR due to the additional test scenarios requested.

@artursouza artursouza merged commit 6b7c94f into dapr:master Feb 6, 2024
31 of 32 checks passed
@JoshVanL JoshVanL added this to the v1.13 milestone Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autoupdate DaprBot will keep the Pull Request up to date with master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Daprd Metrics Breaking Change
8 participants