Skip to content

fix: normalize telemetry taxonomy values to conform with Ansible NRT v1.0 - #771

Merged
SirGitsalot merged 1 commit into
ansible-collections:masterfrom
stevefulme1:fix/normalize-telemetry-taxonomy
Jul 27, 2026
Merged

fix: normalize telemetry taxonomy values to conform with Ansible NRT v1.0#771
SirGitsalot merged 1 commit into
ansible-collections:masterfrom
stevefulme1:fix/normalize-telemetry-taxonomy

Conversation

@stevefulme1

Copy link
Copy Markdown
Contributor

Summary

The taxonomy.jq audit filter emits raw GCP API kind strings as device_type values and uses inconsistent casing for infra_bucket / infra_type. This blocks automated cross-vendor reporting against the Ansible Normalized Resource Taxonomy v1.0.

Before:

  • device_type: "compute#instance" (raw GCP kind string)
  • infra_bucket: "COMPUTE" (ascii_upcase applied)
  • infra_type: "PublicCloud"

After:

  • device_type: "virtual_machine" (normalized taxonomy value)
  • infra_bucket: "compute" (lowercase snake_case)
  • infra_type: "public_cloud"

Changes

  • Add device_type normalization map — 23 GCP kind strings mapped to taxonomy values
  • Normalize infra_bucket values to lowercase snake_case directly in the mapping
  • Remove ascii_upcase from infra_bucket output (values are now pre-normalized)
  • Graceful fallback — unmapped kind strings pass through as-is

Normalization Table

GCP Kind Normalized device_type infra_bucket
compute#instance virtual_machine compute
compute#disk block_storage storage
compute#firewall firewall security_identity
compute#network vpc networking
compute#address vpc networking
storage#bucket object_storage storage
sql#instance database_relational database
container#cluster kubernetes_cluster compute
iam#role iam security_identity
iam#serviceAccount iam security_identity
dns#managedZone dns networking
pubsub#topic messaging app_integration_messaging
bigquery#dataset database_analytics database
file#instance file_storage storage
cloudkms#keyRing key_vault security_identity

Test Plan

  • JQ filter parses and executes successfully
  • Tested with sample GCP compute instance data — correct normalization
  • Unknown kind values fall through gracefully
  • Integration test with AAP telemetry pipeline (post-merge)

Signed-off-by: Steve Fulmer sfulmer@redhat.com (Red Hat)

…v1.0

The taxonomy.jq audit filter emits raw GCP API kind strings as
device_type values (e.g., "compute#instance"), uses title-case
infra_bucket values (e.g., "Compute", "Network"), and applies
ascii_upcase which produces all-caps output. This blocks automated
cross-vendor reporting against the Ansible Normalized Resource Taxonomy.

Changes:
- Normalize infra_bucket values to lowercase snake_case
  (e.g., "Database", "Network" -> "database", "networking")
- Add device_type normalization map for GCP kind strings
  (e.g., "compute#instance" -> "virtual_machine",
   "storage#bucket" -> "object_storage",
   "compute#firewall" -> "firewall")
- Normalize infra_type from "PublicCloud" to "public_cloud"
- Remove ascii_upcase from infra_bucket output
- Unknown device_type values fall through to raw kind string

Signed-off-by: Steve Fulmer <sfulmer@redhat.com>
@sonarqubecloud

Copy link
Copy Markdown

@SirGitsalot
SirGitsalot merged commit 839b3fb into ansible-collections:master Jul 27, 2026
31 checks passed
infra_bucket: ($actions[$data.action] // "Unknown" | ascii_upcase),
device_type: $kind,
infra_type: "public_cloud",
infra_bucket: $actions[$data.action],

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.

Won't this fail then if it can't match? I would think they would want the data to be able to search on unknown to know what is being missed? Maybe do the same as you do for kind below?

@stevefulme1

Copy link
Copy Markdown
Contributor Author

@p3ck Good catch Bill — you're right, dropping the fallback means unmapped modules produce null instead of a searchable value. Opened #772 to restore it with // "unknown", matching the device_type pattern on the next line.

SirGitsalot pushed a commit that referenced this pull request Jul 29, 2026
Modules not present in the action lookup table produced null
infra_bucket values instead of a searchable fallback. Apply the
same // fallback pattern used by device_type so NRT consumers
can filter on 'unknown' to identify missing mappings.

Addresses review feedback from #771.
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.

3 participants