Skip to content

[ECOINT-139] Stonebranch Integration for Datadog - #2866

Open
Len0608 wants to merge 54 commits into
DataDog:masterfrom
Len0608:stonebranch
Open

Len0608 wants to merge 54 commits into
DataDog:masterfrom
Len0608:stonebranch

Conversation

@Len0608

@Len0608 Len0608 commented Dec 16, 2025

Copy link
Copy Markdown

What does this PR do?

A brief description of the change being made with this pull request.

  • Added integration for Stonebranch to scrape metrics from the prometheus endpoint from the Universal Controller.

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

  • PR has a meaningful title or PR has the no-changelog label attached
  • Feature or bugfix has tests
  • Git history is clean
  • If PR impacts documentation, docs team has been notified or an issue has been opened on the documentation repo
  • If this PR includes a log pipeline, please add a description describing the remappers and processors.

Additional Notes

Anything else we should know when reviewing?

@Len0608
Len0608 requested review from a team as code owners December 16, 2025 10:50
@drichards-87 drichards-87 added the editorial review Waiting on a more in-depth review from a docs team editor label Dec 16, 2025
@drichards-87

Copy link
Copy Markdown
Contributor

Created DOCS-12926 for Docs Team review.

@dd-dominic

Copy link
Copy Markdown
Contributor

@Len0608 thanks for opening a new PR. You can ignore the "validate repository" check for now, but please resolve the test failures.

@github-actions

github-actions Bot commented Jan 6, 2026

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the stale label Jan 6, 2026
@Len0608

Len0608 commented Jan 12, 2026 •

Copy link
Copy Markdown
Author

I updated ddev to version 14.10 for linux and ran ddev lint once. It resolved with

$ ddev test --lint stonebranch

stonebranch lint

cmd [1] | ruff format --diff --check --config ../pyproject.toml .
5 files already formatted
cmd [2] | ruff check --config ../pyproject.toml .
All checks passed!

The GH actions still give the linting error for the test actions

@dd-dominic

Copy link
Copy Markdown
Contributor

@Len0608 have you tried running ddev test --fmt?

@github-actions github-actions Bot removed the stale label Jan 12, 2026
@dd-dominic dd-dominic changed the title Stonebranch Integration for Datadog [ECOINT-139] Stonebranch Integration for Datadog Jan 12, 2026
@Len0608

Len0608 commented Jan 13, 2026

Copy link
Copy Markdown
Author

@Len0608 have you tried running ddev test --fmt?

Running the command results in the following:
/dd/integrations-extras/stonebranch$ ddev test --fmt No changed testable targets found

Running it to test all, has also shown no changes

@nubtron nubtron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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!

@Len0608

Len0608 commented Jan 15, 2026 •

Copy link
Copy Markdown
Author

Hello @nubtron! I have confirmed with your commands given, this is the following output:

integrations-extras$ ddev config set repo extras
New setting:
repo = "extras"
integrations-extras$ ddev test --fmt stonebranch
stonebranch 
lint 
cmd [1] | ruff format  --config ../pyproject.toml .
5 files left unchanged
cmd [2] | ruff check --fix --config ../pyproject.toml .
All checks passed!

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:

repo = "extras"
agent = "dev"
org = "ci"
extras = "/home/len/.../integrations-extras"

[repos]
core = "~/dd/integrations-core"
extras = "/home/len/.../integrations-extras"
marketplace = "~/dd/marketplace"
agent = "~/dd/datadog-agent"

@nubtron

nubtron commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator

@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?

@nubtron

nubtron commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator

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?

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.

@Len0608

Len0608 commented Jan 20, 2026

Copy link
Copy Markdown
Author

@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.

@nubtron nubtron self-assigned this Jan 22, 2026
@nubtron

nubtron commented Jan 22, 2026

Copy link
Copy Markdown
Collaborator

Hi @Len0608, thanks, will look into it shortly! In the meantime I noticed that another validation has failed, you can fix it by running ddev validate ci --sync with the latest version of ddev.

@nubtron nubtron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @Len0608! Thanks for the changes! The next validation is failing

Comment thread stonebranch/metadata.csv Outdated
@@ -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,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

@nubtron nubtron Jan 27, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Comment thread stonebranch/README.md Outdated
@@ -0,0 +1,30 @@
# Stonebranch

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you follow a template similar to this, for the README?

from datadog_checks.base import OpenMetricsBaseCheckV2


class StonebranchCheck(OpenMetricsBaseCheckV2):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@Len0608

Len0608 commented Feb 9, 2026

Copy link
Copy Markdown
Author

Hello @nubtron, I have moved the config to the spec.yaml and updated the Readme. Does this look better now?

Comment thread stonebranch/README.md Resolved
Comment thread stonebranch/README.md Resolved
Comment thread stonebranch/README.md Resolved
Comment thread stonebranch/README.md Resolved
Comment thread stonebranch/README.md Resolved
@nubtron

nubtron commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator

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.
@Len0608
Len0608 requested a review from nubtron September 16, 2026 09:01

@nubtron nubtron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment thread .github/CODEOWNERS
/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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks like @DataDog/ecosystems-review was accidentally removed from /storm/, could you restore it?

@mgashaj

mgashaj commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Hi @Len0608 thanks for the dashboard - the section structure is great. A few requests before we merge:

  1. Screenshots: please share new screenshots in both light and dark mode, taken over at least several hours of realistic load (the current one is an 11-minute window on a nightly build with 3 databases).
  2. Scale: widgets grouped by database/collection/index (especially "Indexing Reduced throughput") will get crowded for customers with many databases — please limit them to the top 10, and consider adding a database_name template variable.
  3. Units: "Document writes rate" shows hours on the y-axis (should be docs/second); "Certificate expires in" converts to days but is labeled in hours.
  4. Thresholds: "Disk remaining" needs a warning color when disk is low; "Databases loaded" turns green only above 40; please double-check the rule order on the license and certificate expiry tiles so the under-7-days red actually shows.
  5. Polish: give the About and Resources notes enough height to show their content without "More"; show the license type as a name instead of a number; use one consistent node label across widgets; make title capitalization consistent.

@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the stale label Oct 22, 2026
@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot closed this Oct 30, 2026
@Len0608

Len0608 commented Nov 2, 2026

Copy link
Copy Markdown
Author

@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.

@nubtron nubtron reopened this Nov 5, 2026
@nubtron

nubtron commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Hi @Len0608, no problem, thank you for the changes! I re-opened the PR, you should be able to push them.

@github-actions github-actions Bot removed the stale label Nov 5, 2026
@Len0608
Len0608 requested a review from nubtron November 10, 2026 08:33

@nubtron nubtron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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": {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Suggested change
"metadata_label_map": {
"rename_labels": {"version": "jvm_version"},
"metadata_label_map": {

Comment thread stonebranch/tests/test_unit.py Outdated
instance = {
"openmetrics_endpoint": url,
"metric_groups": ["jvm", "process", "license_details"],
"rename_labels": {"version": "jvm_version"},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

With the rename in the check, the test doesn't need to set it anymore:

Suggested change
"rename_labels": {"version": "jvm_version"},

Comment on lines +163 to +165
aggregator.assert_metrics_using_metadata(
get_metadata_metrics(), check_submission_type=True, check_symmetric_inclusion=True
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

And this checks the renamed tag, so the test fails if the rename is ever removed:

Suggested change
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")

Comment on lines +9 to +12
"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",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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:

Suggested change
"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",

Comment thread .github/CODEOWNERS Outdated
/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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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).

Suggested change
/stonebranch/ @len06080 len-maurice.seemann@stonebranch.com
/stonebranch/ @Len0608 len-maurice.seemann@stonebranch.com @DataDog/ecosystems-review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

oh not sure why i had an extra 0 there for the username. will change.

Comment on lines +1528 to +1544
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 }}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Suggested 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 }}"
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.
@Len0608
Len0608 requested a review from a team as a code owner November 24, 2026 08:38
@Len0608
Len0608 requested a review from Jiawen23 November 24, 2026 08:38

@nubtron nubtron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you very much @Len0608! Approving as the engineering reviewer!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants