Repository navigation
Conversation
|
Created DOCS-12926 for Docs Team review. |
|
@Len0608 thanks for opening a new PR. You can ignore the "validate repository" check for now, but please resolve the test failures. |
|
This pull request has not been updated for more than 21 days. If there are no updates to this PR within 7 days, it will be closed. If you'd like to re-open this PR after it's been closed, you can start from the latest master branch or pull the latest changes into your branch and create a new pull request. |
|
I updated ddev to version 14.10 for linux and ran ddev lint once. It resolved with
stonebranch lintcmd [1] | ruff format --diff --check --config ../pyproject.toml . The GH actions still give the linting error for the test actions |
|
@Len0608 have you tried running |
Running the command results in the following: Running it to test all, has also shown no changes |
nubtron
left a comment
There was a problem hiding this comment.
Hi @Len0608, it might be that ddev is not configured correctly. Could you double-check the configuration, run ddev config set repo extras and then re-run ddev test --fmt stonebranch?
Also could you please commit your metadata.csv to the stonebranch directory? If you'd don't have it ready and you would like assistance on how to create it, just let me know!
|
Hello @nubtron! I have confirmed with your commands given, this is the following output: It seems that it did not change anything on the stonebranch folder itself. When checking the error of the GH action it looks like it is removing empty lines which do not even exist in the files I have uploaded. On the topic of the metadata.csv, as far as I understand this will be the metric list of all the metrics which will be scraped by the Agent correct? Edit: for completeness purposes, here is my ddev config: |
|
@Len0608 hmm I can see the empty line in the file, is it possible the fix was applied locally but didn’t make it into the push to GitHub? |
That's right! It documents the metrics that will be scraped, and lets you set some metadata such as units of measure and decription. You can also then use the "assert_metrics_using_metadata" test. It doesn't control which metrics are sent however, it only documents them - the implementation will still have to be done in Python. |
|
@nubtron after reediting the files then running ddev test --fmt stonebranch it finally worked and changed the files again. I am not sure what the issue with that is but the test checks have passed now. I have also added the metadata.csv in the extension. |
|
Hi @Len0608, thanks, will look into it shortly! In the meantime I noticed that another validation has failed, you can fix it by running |
| @@ -0,0 +1,65 @@ | |||
| metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric | |||
| stonebranch.jvm_classes_currently_loaded,gauge,60,class,,The number of classes that are currently loaded in the JVM,0,stonebranch,jvm classes loaded, | |||
There was a problem hiding this comment.
You can leave the interval empty, it will be managed by the Agent. You can change the value in stonebranch/datadog_checks/stonebranch/config_models/defaults.py if you think it's necessary but we very rarely change this value.
There was a problem hiding this comment.
I addressed the changes in the metadata. I am running into the issue of the ddev validate metadata failing. I get the following error: └── stonebranch
└── stonebranch/metadata.csv
stonebranch: metric_prefix does not exist in manifest or overrides.
From the instructions of creating the PR structure it was mentioned that there should be no manifest created. I tested it with a simple one but that just leads to more issues down the line. I removed it for now but the validate will fail due the issue mentioned above.
There was a problem hiding this comment.
Confirmed - there should be no manifest for this integration.
The override mentioned in the error message mentioned goes in .ddev/config.toml:
[overrides.metrics-prefix]
stonebranch = "stonebranch."Since the no-manifest flow is relatively new, [overrides.metrics-prefix] section is not present in that file yet and you'll need to add it.
After that the ddev metadata validation should pass. Let me know if you have other issues!
| @@ -0,0 +1,62 @@ | |||
| init_config: | |||
There was a problem hiding this comment.
The conf.yaml.example file is typically generated from spec.yaml rather than hand-crafted. Here's an example:
https://github.com/DataDog/integrations-core/blob/master/krakend/assets/configuration/spec.yaml
| @@ -0,0 +1,30 @@ | |||
| # Stonebranch | |||
There was a problem hiding this comment.
Could you follow a template similar to this, for the README?
| from datadog_checks.base import OpenMetricsBaseCheckV2 | ||
|
|
||
|
|
||
| class StonebranchCheck(OpenMetricsBaseCheckV2): |
There was a problem hiding this comment.
Could you follow the pattern here rather than using the config file to select the metrics?
The yaml config file is meant for user overrides, while check.py/metrics.py are meant for the integration developer to set.
|
Hello @nubtron, I have moved the config to the spec.yaml and updated the Readme. Does this look better now? |
|
Thanks @Len0608 for the changes! Will review shortly! |
uc_license_* and jvm_* metrics are in ADDITIONAL_METRICS groups (license_details and jvm) which are not enabled in the default instance config. Only assert gauges from DEFAULT_METRICS that are present in the fixture and always collected.
nubtron
left a comment
There was a problem hiding this comment.
Hi @Len0608 , thanks for adding the real payload!
Could you also use it in test_unit.py, with all metric groups enabled and the bidirectional metadata check? For example:
from pathlib import Path
def test_real_payload_matches_metadata(aggregator, dd_run_check, mock_http_response):
mock_http_response(file_path=Path(__file__).parent / "fixtures" / "metrics.txt")
instance = {
"openmetrics_endpoint": "http://test.local/metrics",
"metric_groups": ["jvm", "process", "license_details"],
}
check = StonebranchCheck("stonebranch", {}, [instance])
dd_run_check(check)
dd_run_check(check)
aggregator.assert_metrics_using_metadata(
get_metadata_metrics(), check_submission_type=True, check_symmetric_inclusion=True
)This checks that the emitted metrics are in metadata.csv, and also that every metric in the csv is emitted. Running the check twice lets us test the counters, since they depend on the difference between two cycles.
| /statsig/ @marcos-statsig support@statsig.com @DataDog/ecosystems-review | ||
| /statsig_rum/ @crstatsig support@statig.com @DataDog/ecosystems-review | ||
| /steadybit/ @bripkens support@steadybit.com @DataDog/ecosystems-review | ||
| /storm/ @platinummonkey @DataDog/ecosystems-review |
There was a problem hiding this comment.
It looks like @DataDog/ecosystems-review was accidentally removed from /storm/, could you restore it?
|
Hi @Len0608 thanks for the dashboard - the section structure is great. A few requests before we merge:
|
|
This pull request has not been updated for more than 21 days. If there are no updates to this PR within 7 days, it will be closed. If you'd like to re-open this PR after it's been closed, you can start from the latest master branch or pull the latest changes into your branch and create a new pull request. |
|
This pull request was not updated after an additional 7 days of no activity. If you would like to continue work on this PR, please re-open this PR or create a fresh branch off of the latest master branch. |
|
@nubtron, apologies, I couldn't update the Integration the past weeks. can we reopen the PR for continued work? I have addressed the issues you have brought up. |
|
Hi @Len0608, no problem, thank you for the changes! I re-opened the PR, you should be able to push them. |
…tly and improve mock HTTP response handling
nubtron
left a comment
There was a problem hiding this comment.
Thanks for the update @Len0608! The real-payload test with all metric groups is exactly what I was hoping for, and it already caught the GC summary and duration histogram types. A few last things before approval, with suggestions you can apply directly from here:
| "openmetrics_endpoint": endpoint, | ||
| "namespace": self.__NAMESPACE__, | ||
| "metrics": metrics, | ||
| "metadata_label_map": { |
There was a problem hiding this comment.
Request: Could you move the version -> jvm_version rename from the test into the check? jvm_runtime_info has a version label, and version is a reserved tag in Datadog (it's used for unified service tagging). That's why the test needed the rename, but right now users who enable the jvm group would still get the raw version tag. Other integrations do this rename in the check too; for example, karpenter renames version to go_version.
| "metadata_label_map": { | |
| "rename_labels": {"version": "jvm_version"}, | |
| "metadata_label_map": { |
| instance = { | ||
| "openmetrics_endpoint": url, | ||
| "metric_groups": ["jvm", "process", "license_details"], | ||
| "rename_labels": {"version": "jvm_version"}, |
There was a problem hiding this comment.
With the rename in the check, the test doesn't need to set it anymore:
| "rename_labels": {"version": "jvm_version"}, |
| aggregator.assert_metrics_using_metadata( | ||
| get_metadata_metrics(), check_submission_type=True, check_symmetric_inclusion=True | ||
| ) |
There was a problem hiding this comment.
And this checks the renamed tag, so the test fails if the rename is ever removed:
| aggregator.assert_metrics_using_metadata( | |
| get_metadata_metrics(), check_submission_type=True, check_symmetric_inclusion=True | |
| ) | |
| aggregator.assert_metrics_using_metadata( | |
| get_metadata_metrics(), check_submission_type=True, check_symmetric_inclusion=True | |
| ) | |
| aggregator.assert_metric_has_tag("stonebranch.jvm_runtime_info", "jvm_version:17.0.11+9-LTS") |
| "name": "[Stonebranch] OMS server disconnected on {{endpoint.name}}", | ||
| "type": "query alert", | ||
| "query": "min(last_5m):avg:stonebranch.uc_oms_server.status{*} by {endpoint,device} < 1", | ||
| "message": "The Stonebranch OMS server {{device.name}} is reporting a disconnected status on endpoint {{endpoint.name}}.\n\nCheck the OMS server process and network connectivity between the Universal Controller and OMS.\n\n@pagerduty @slack-alerts", |
There was a problem hiding this comment.
Request: This monitor groups by device, but uc_oms_server_status doesn't have a device tag; its tags are server_address and last_connected. So all OMS servers on an endpoint end up in a single alert, and {{device.name}} shows up empty. Grouping by server_address lets the alert say which server is down:
| "name": "[Stonebranch] OMS server disconnected on {{endpoint.name}}", | |
| "type": "query alert", | |
| "query": "min(last_5m):avg:stonebranch.uc_oms_server.status{*} by {endpoint,device} < 1", | |
| "message": "The Stonebranch OMS server {{device.name}} is reporting a disconnected status on endpoint {{endpoint.name}}.\n\nCheck the OMS server process and network connectivity between the Universal Controller and OMS.\n\n@pagerduty @slack-alerts", | |
| "name": "[Stonebranch] OMS server {{server_address.name}} disconnected on {{endpoint.name}}", | |
| "type": "query alert", | |
| "query": "min(last_5m):avg:stonebranch.uc_oms_server.status{*} by {endpoint,server_address} < 1", | |
| "message": "The Stonebranch OMS server {{server_address.name}} is reporting a disconnected status on endpoint {{endpoint.name}}.\n\nCheck the OMS server process and network connectivity between the Universal Controller and OMS.\n\n@pagerduty @slack-alerts", |
| /statsig/ @marcos-statsig support@statsig.com @DataDog/ecosystems-review | ||
| /statsig_rum/ @crstatsig support@statig.com @DataDog/ecosystems-review | ||
| /steadybit/ @bripkens support@steadybit.com @DataDog/ecosystems-review | ||
| /stonebranch/ @len06080 len-maurice.seemann@stonebranch.com |
There was a problem hiding this comment.
Request: @len06080 isn't a GitHub account, so GitHub can't request your review on future Stonebranch changes. I think it should be @Len0608. Could you also add @DataDog/ecosystems-review? The other partner-maintained integrations include it (see #3161).
| /stonebranch/ @len06080 len-maurice.seemann@stonebranch.com | |
| /stonebranch/ @Len0608 len-maurice.seemann@stonebranch.com @DataDog/ecosystems-review |
There was a problem hiding this comment.
oh not sure why i had an extra 0 there for the username. will change.
| uses: DataDog/integrations-core/.github/workflows/test-target.yml@5f6b58dfb609ea0afb37762612dbb6e2c37d2933 | ||
| with: | ||
| job-name: stonebranch | ||
| target: stonebranch | ||
| platform: linux | ||
| runner: '["ubuntu-22.04"]' | ||
| repo: "${{ inputs.repo }}" | ||
| context: ${{ inputs.context }} | ||
| python-version: "${{ inputs.python-version }}" | ||
| latest: ${{ inputs.latest }} | ||
| agent-image: "${{ inputs.agent-image }}" | ||
| agent-image-py2: "${{ inputs.agent-image-py2 }}" | ||
| agent-image-windows: "${{ inputs.agent-image-windows }}" | ||
| agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" | ||
| test-py2: ${{ inputs.test-py2 }} | ||
| test-py3: ${{ inputs.test-py3 }} | ||
| setup-env-vars: "${{ inputs.setup-env-vars }}" |
There was a problem hiding this comment.
Request: Could you apply this suggestion? After this job was added, master pinned every CI job to a fixed version of the shared test workflow and of ddev (#3265). This job still points to the older workflow, so Stonebranch tests run on different tooling from every other integration. Re-running ddev validate ci --sync won't update it, because it keeps the settings of jobs that already exist, so applying this change is the simplest fix.
| uses: DataDog/integrations-core/.github/workflows/test-target.yml@5f6b58dfb609ea0afb37762612dbb6e2c37d2933 | |
| with: | |
| job-name: stonebranch | |
| target: stonebranch | |
| platform: linux | |
| runner: '["ubuntu-22.04"]' | |
| repo: "${{ inputs.repo }}" | |
| context: ${{ inputs.context }} | |
| python-version: "${{ inputs.python-version }}" | |
| latest: ${{ inputs.latest }} | |
| agent-image: "${{ inputs.agent-image }}" | |
| agent-image-py2: "${{ inputs.agent-image-py2 }}" | |
| agent-image-windows: "${{ inputs.agent-image-windows }}" | |
| agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" | |
| test-py2: ${{ inputs.test-py2 }} | |
| test-py3: ${{ inputs.test-py3 }} | |
| setup-env-vars: "${{ inputs.setup-env-vars }}" | |
| uses: DataDog/integrations-core/.github/workflows/test-target.yml@fbcbeeff8a3c16ddea273752bbefb61fe589d6bd | |
| with: | |
| job-name: stonebranch | |
| target: stonebranch | |
| platform: linux | |
| runner: '["ubuntu-22.04"]' | |
| repo: "${{ inputs.repo }}" | |
| context: ${{ inputs.context }} | |
| python-version: "${{ inputs.python-version }}" | |
| latest: ${{ inputs.latest }} | |
| agent-image: "${{ inputs.agent-image }}" | |
| agent-image-py2: "${{ inputs.agent-image-py2 }}" | |
| agent-image-windows: "${{ inputs.agent-image-windows }}" | |
| agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" | |
| test-py2: ${{ inputs.test-py2 }} | |
| test-py3: ${{ inputs.test-py3 }} | |
| setup-env-vars: "${{ inputs.setup-env-vars }}" | |
| ddev-version: ==20.2.0 |
…ionality - Added @DataDog/ecosystems-review to CODEOWNERS for Stonebranch. - Updated OMS disconnected monitor to include server address in the name and message. - Modified check.py to support renaming labels for metrics. - Adjusted unit test to assert the presence of the renamed label.
What does this PR do?
A brief description of the change being made with this pull request.
The integration has been created by following the documentation on how to build an agent based integration from Datadog. Then implementing the check and test for the Prometheus scrape.
Motivation
What inspired you to submit this pull request?
To kick off the integration between Datadog and Stonebranch
Review checklist
no-changeloglabel attachedAdditional Notes
Anything else we should know when reviewing?