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

[EEM] Fix ingest pipeline to not overwrite existing parents in metadata #186672

Merged

Conversation

simianhacker
Copy link
Member

@simianhacker simianhacker commented Jun 21, 2024

Summary

This fixes #186668 by adding a check to see if a HashMap exists before creating a new one. This happens when the ingest pipeline converts the output from a transfrom's terms sub-aggregation output to a list of terms.

Testing

Use Syntrace to generate data with this command:

node scripts/synthtrace packages/kbn-apm-synthtrace/src/scenarios/continuous_rollups.ts --live

Then create this Entity definition:

POST kbn:/internal/api/entities/definition
{
  "id": "apm-countinuous-rollups",
  "name": "Services for APM",
  "type": "service",
  "indexPatterns": ["logs-*", "metrics-*", "traces-*"],
  "history": {
    "timestampField": "@timestamp",
    "interval": "1m"
  },
  "identityFields": ["service.name", "service.environment"],
  "displayNameTemplate": "{{service.name}}:{{service.environment}}",
  "metadata": [
    "host.name",
    "transaction.name",
    "transaction.type",
    "observer.version"
  ],
  "metrics": [
    {
      "name": "latency",
      "equation": "A",
      "metrics": [
        {
          "name": "A",
          "aggregation": "avg",
          "field": "transaction.duration.histogram"
        }
      ]
    },
    {
      "name": "throughput",
      "equation": "A / 5",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count"
        }
      ]
    },
    {
      "name": "failedTransRate",
      "equation": "A / B",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count",
          "filter": "event.outcome: \"failure\""
        },
        {
          "name": "B",
          "aggregation": "doc_count",
          "filter": "event.outcome: *"
        }
      ]
    }
  ]
}

Query the history with:

POST .entities-observability.history-v1.*/_search?track_total_hits=true
{
  "sort": [
    {
      "@timestamp": {
        "order": "desc"
      }
    }
  ]
}

and query the latest with:

POST .entities-observability.latest-v1.*/_search?track_total_hits=true
{}

You should see transaction.name with a list of transactions and transaction.type with a list of the different transaction types.

@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@simianhacker simianhacker marked this pull request as ready for review June 21, 2024 20:39
@simianhacker simianhacker requested a review from a team as a code owner June 21, 2024 20:39
@simianhacker simianhacker added release_note:skip Skip the PR/issue when compiling release notes Team:obs-knowledge Observability Experience Knowledge team v8.15.0 labels Jun 21, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-knowledge-team (Team:obs-knowledge)

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jun 21, 2024
Copy link
Contributor

@tommyers-elastic tommyers-elastic left a comment

Choose a reason for hiding this comment

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

LGTM

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jun 24, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@simianhacker simianhacker merged commit 9009cb8 into elastic:main Jun 24, 2024
27 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 24, 2024
@miltonhultgren miltonhultgren added the Feature:EEM Elastic Entity Model label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project Feature:EEM Elastic Entity Model release_note:skip Skip the PR/issue when compiling release notes Team:obs-knowledge Observability Experience Knowledge team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EEM] When 2 metadata fields belong to the same parent only one shows up.
8 participants