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

Expose agent label constants #606

Merged
merged 5 commits into from
Mar 18, 2024
Merged

Conversation

ka3de
Copy link
Contributor

@ka3de ka3de commented Feb 7, 2024

This PR makes modifications to the agent in order to expose how many max labels are associated for any metric and log for each of the supported probes. For example, how many labels are associated at max for any metric from the ones reported when running an HTTP probe.

This information is required in order to validate that the check labels set from the API will not exceed the particular tenant limits for the metrics and logs backends (e.g.: mimir and loki).

A change in the number of max labels being generated from the agent could potentially make some check exceed the tenant limits, therefore there is a test in place (TestValidateLabels) which should alert us to update the values and review the tenant limits and possibly take some actions prior to the release. Other possible strategies such as giving extra room when defining the max number of check labels allowed should be taken into account from the API.

Updates https://github.com/grafana/synthetic-monitoring/issues/5

@ka3de ka3de self-assigned this Feb 7, 2024
Base automatically changed from feat/tenant-labels-limits to main February 12, 2024 13:33
@ka3de ka3de force-pushed the feat/tenant-labels-limits-agent-labels branch from 50bc556 to c2d29fc Compare February 16, 2024 09:57
Extracts the probe setup functions so test is simplified and these can
be reused for other scraper tests.
Defines public functions that return the maximum number of labels that
can be set for a metric and a log stream. These are static per agent
version, therefore are defined as private constants, but are exposed
through a public function to make it more "intuitive" to understand that
they may vary between agent versions, and also to allow encapsulating
logic in these methods in the future if required.
The purpose of this test is to verify that the currently defined
constants for max metric and log labels set by the agent still apply and
have not changed due to modifications, in which case the constants
should be updated.
This should now be done in the API taking into account the particular
tenant limits.
@ka3de ka3de force-pushed the feat/tenant-labels-limits-agent-labels branch from c2d29fc to 5e12d74 Compare March 6, 2024 10:17
@ka3de ka3de marked this pull request as ready for review March 12, 2024 13:29
@ka3de ka3de requested a review from a team as a code owner March 12, 2024 13:29
@ka3de ka3de requested a review from mem March 12, 2024 13:31
This reverts commit 5e12d74.
This modification is now moved to a separate PR (see #659).
@ka3de ka3de merged commit 8442fb5 into main Mar 18, 2024
4 checks passed
@ka3de ka3de deleted the feat/tenant-labels-limits-agent-labels branch March 18, 2024 09:35
ka3de added a commit that referenced this pull request Mar 18, 2024
* Expose agent label constants (#606)

Signed-off-by: ka3de <danijs12@hotmail.com>
@ka3de ka3de mentioned this pull request Mar 18, 2024
ka3de added a commit that referenced this pull request Mar 18, 2024
* Expose agent label constants (#606)

Signed-off-by: ka3de <danijs12@hotmail.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants