Skip to content

Conversation

@mrodm
Copy link
Collaborator

@mrodm mrodm commented Feb 3, 2025

Proposed commit message

Updated failing mappings found for envoyproxy and mongodb_atlas packages when elastic-package uses validation based on mappings.

envoyproxy

Added missing mappings for envoy.thread_local_cluster_manager metrics.
Added the same mappings as the other groups (mean, min, max, count and so on).

Example of error found (buildkite link):

test case failed: one or more errors found in mappings in metrics-envoyproxy.stats index template:
[0] field "envoy.thread_local_cluster_manager.worker_0_clusters_inflated.value" is undefined: field definition not found

mongodb_atlas

Update flattened field definitions to not create dynamic templates.

As they were previously, this dynamic template is created:

      "dynamic_templates": [
        {
          "mongodb_atlas.project.additional_info.*": {
            "path_match": "mongodb_atlas.project.additional_info.*",
            "match_mapping_type": "object",
            "mapping": {
              "type": "flattened"
            }
          }
        },
      ]

With the change of this PR, this mapping is created as:

        "mongodb_atlas": {
          "properties": {
            "project": {
              "properties": {
                "additional_info": {
                  "type": "flattened"
                },
              },
            },
          },
        },

Example of errors found (buildkite link):

test case failed: one or more errors found in mappings in logs-mongodb_atlas.project index template:
[0] field "mongodb_atlas.project.additional_info._t" is undefined: field definition not found
[1] field "mongodb_atlas.project.additional_info.cid" is undefined: field definition not found
[2] field "mongodb_atlas.project.additional_info.cre" is undefined: field definition not found
[3] field "mongodb_atlas.project.additional_info.description" is undefined: field definition not found
...

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

How to test this PR locally

Run elastic-package with mappings validation enabled and run system tests:

cd packages/<package>
elastic-package stack up -v -d --version <kibana_constraint>
export ELASTIC_PACKAGE_FIELD_VALIDATION_TEST_METHOD=mappings
# Add defer-cleanup to check the data ingested in the corresponding indices/data streams
elastic-package test system -v --data-streams memory --defer-cleanup 900s

elastic-package stack down -v

Related issues

@mrodm mrodm self-assigned this Feb 3, 2025
@andrewkroh andrewkroh added Integration:1password 1Password (Partner supported) Integration:abnormal_security Abnormal AI New Integration Issue or pull request for creating a new integration package. labels Feb 4, 2025
@mrodm mrodm force-pushed the update_obs-infraobs-integrations_mappings branch from 1778899 to 959efee Compare February 4, 2025 17:22
@mrodm mrodm force-pushed the update_obs-infraobs-integrations_mappings branch from 959efee to e122783 Compare February 4, 2025 19:02
@mrodm mrodm removed Integration:1password 1Password (Partner supported) Integration:abnormal_security Abnormal AI New Integration Issue or pull request for creating a new integration package. labels Feb 5, 2025
@mrodm mrodm force-pushed the update_obs-infraobs-integrations_mappings branch from e122783 to e9a1f16 Compare February 5, 2025 17:30
@elastic-vault-github-plugin-prod
Copy link

elastic-vault-github-plugin-prod bot commented Feb 5, 2025

🚀 Benchmarks report

Package envoyproxy 👍(0) 💚(0) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
log 1290.32 1028.81 -261.51 (-20.27%) 💔

Package mongodb_atlas 👍(3) 💚(3) 💔(2)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
alert 3115.26 2433.09 -682.17 (-21.9%) 💔
hardware 17857.14 6666.67 -11190.47 (-62.67%) 💔

To see the full report comment with /test benchmark fullreport

@mrodm mrodm force-pushed the update_obs-infraobs-integrations_mappings branch from a6cf529 to 8771d6c Compare February 6, 2025 12:58
Comment on lines 1068 to 1069
# Is this required to be added ? Or, the Ingest pipeline requires to be revisited?
- name: thread_local_cluster_manager
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

According to the pipeline, thread_local_cluster_manager is a special case:

- thread_local_cluster_manager
- cluster_manager
- tls_inspector

The other two special cases had definitions, but thread_local_cluster_manager does not.
- name: cluster_manager
type: group
fields:
- name: '*.count'
type: object
object_type: double
object_type_mapping_type: "*"
metric_type: counter
description: Envoyproxy counters
- name: '*.max'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy max timers metric
- name: '*.mean_rate'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy mean rate timers metric
- name: '*.mean'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy mean timers metric
- name: '*.median'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy median timers metric
- name: '*.min'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy min timers metric
- name: '*.stddev'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy standard deviation timers metric
- name: '*.value'
type: object
object_type: double
object_type_mapping_type: "*"
metric_type: gauge
description: Envoyproxy gauges
- name: tls_inspector
type: group
fields:
- name: '*.count'
type: object
object_type: double
object_type_mapping_type: "*"
metric_type: counter
description: Envoyproxy counters
- name: '*.max'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy max timers metric
- name: '*.mean_rate'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy mean rate timers metric
- name: '*.mean'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy mean timers metric
- name: '*.median'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy median timers metric
- name: '*.min'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy min timers metric
- name: '*.stddev'
type: object
object_type: double
object_type_mapping_type: "*"
description: Envoyproxy standard deviation timers metric
- name: '*.value'
type: object
object_type: double
object_type_mapping_type: "*"
metric_type: gauge
description: Envoyproxy gauges

In this PR, I've added the definition for that group following the same approach of the other two fields. Is that ok?

Depending on the execution, there are documents ingested with these fields.

Comment on lines +76 to 77
- name: additional_info
type: flattened
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Previous definition with .* was not matching the fields under additional_info. And therefore all the fields were undefined:

[0] field "mongodb_atlas.project.additional_info._t" is undefined: field definition not found
[1] field "mongodb_atlas.project.additional_info.cid" is undefined: field definition not found
...

In order to be defined as flattened, and therefore all elements under additional_info be mapped as a whole JSON object, it needs to be defined without * to avoid creating a dynamic template (see PR description).

Example of contents of mongodb_atlas.project.additional_info:

{
  "severity": "INFO",
  "remote_addr": "0.0.0.0",
  "is_mms_admin": false,
  "hidden": false,
  "description": "User was invited to project",
  "source": "USER",
  "et": "INVITED_TO_GROUP",
  "user_id": "sample_user_id",
  "_t": "USER_AUDIT",
  "cre": "2024-02-21T10:00:29Z",
  "un": "[email protected]",
  "id": "65d5c9bd2c86e3377aa5e5e4",
  "target_username": "[email protected]",
  "ut": "LOCAL",
  "cid": "646f4379c47da356740d14ad"
}

- version: "0.2.0"
changes:
- description: Add field definitions for envoy.thread_local_cluster_manager
type: enhancement
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should this be a bugfix instead?


list_all_directories() {
find . -maxdepth 1 -mindepth 1 -type d | xargs -I {} basename {} | sort
find . -maxdepth 1 -mindepth 1 -type d | xargs -I {} basename {} | sort |grep -E '^(envoyproxy|mongodb_atlas)$'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To be removed the changes in .buildkite/ folder.

@mrodm mrodm marked this pull request as ready for review February 11, 2025 10:13
@mrodm mrodm requested review from a team as code owners February 11, 2025 10:13
Copy link
Contributor

@harnish-crest-data harnish-crest-data left a comment

Choose a reason for hiding this comment

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

Changes for mongodb_atlas package LGTM! 🚀

Copy link
Contributor

@kush-elastic kush-elastic left a comment

Choose a reason for hiding this comment

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

Reviewed envoyproxy.
LGTM

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @mrodm

@elastic-sonarqube
Copy link

@mrodm mrodm merged commit f5769e7 into elastic:main Feb 12, 2025
6 checks passed
@mrodm mrodm deleted the update_obs-infraobs-integrations_mappings branch February 12, 2025 12:41
@elastic-vault-github-plugin-prod

Package envoyproxy - 0.2.0 containing this change is available at https://epr.elastic.co/package/envoyproxy/0.2.0/

@elastic-vault-github-plugin-prod

Package mongodb_atlas - 0.2.1 containing this change is available at https://epr.elastic.co/package/mongodb_atlas/0.2.1/

flexitrev pushed a commit that referenced this pull request Mar 20, 2025
…ased on mappings enabled (#12577)

Updated failing mappings found for "envoyproxy" and "mongodb_atlas"
packages when elastic-package uses validation based on mappings in
system tests to validate the documents/fields.
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.

6 participants