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

Add a column to store value of the property metricDescriptor.type in gcp_logging_metric table. Closes #179 #182

Merged
merged 5 commits into from
May 4, 2021

Conversation

anisadas
Copy link
Contributor

@anisadas anisadas commented Apr 29, 2021

Integration test logs

Logs
SETUP: tests/gcp_logging_metric []

PRETEST: tests/gcp_logging_metric

TEST: tests/gcp_logging_metric
Running terraform
data.google_client_config.current: Refreshing state...
data.null_data_source.resource: Refreshing state...
google_logging_metric.named_test_resource: Creating...
google_logging_metric.named_test_resource: Creation complete after 5s [id=turbottest51011]

Warning: Deprecated Resource

The null_data_source was historically used to construct intermediate values to
re-use elsewhere in configuration, the same can now be achieved using locals


Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Outputs:

project_id = parker-aaa
resource_aka = gcp://logging.googleapis.com/projects/parker-aaa/metrics/turbottest51011
resource_id = turbottest51011
resource_name = turbottest51011

Running SQL query: test-get-query.sql
[
  {
    "description": "Test metric to verify table",
    "filter": "resource.type=gae_app AND severity>=ERROR",
    "label_extractors": {
      "mass": "EXTRACT(jsonPayload.request)",
      "sku": "EXTRACT(jsonPayload.id)"
    },
    "location": "global",
    "metric_descriptor_display_name": "turbottest51011",
    "metric_descriptor_labels": [
      {
        "description": "amount of matter",
        "key": "mass"
      },
      {
        "description": "Identifying number for item",
        "key": "sku",
        "valueType": "INT64"
      }
    ],
    "metric_descriptor_metric_kind": "DELTA",
    "metric_descriptor_type": "logging.googleapis.com/user/turbottest51011",
    "metric_descriptor_unit": "1",
    "metric_descriptor_value_type": "DISTRIBUTION",
    "name": "turbottest51011",
    "project": "parker-aaa",
    "value_extractor": "EXTRACT(jsonPayload.request)"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "description": "Test metric to verify table",
    "filter": "resource.type=gae_app AND severity>=ERROR",
    "label_extractors": {
      "mass": "EXTRACT(jsonPayload.request)",
      "sku": "EXTRACT(jsonPayload.id)"
    },
    "metric_descriptor_display_name": "turbottest51011",
    "metric_descriptor_labels": [
      {
        "description": "amount of matter",
        "key": "mass"
      },
      {
        "description": "Identifying number for item",
        "key": "sku",
        "valueType": "INT64"
      }
    ],
    "metric_descriptor_metric_kind": "DELTA",
    "metric_descriptor_type": "logging.googleapis.com/user/turbottest51011",
    "metric_descriptor_unit": "1",
    "metric_descriptor_value_type": "DISTRIBUTION",
    "name": "turbottest51011",
    "value_extractor": "EXTRACT(jsonPayload.request)"
  }
]
✔ PASSED

Running SQL query: test-invalid-name-query.sql
null
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "description": "Test metric to verify table",
    "name": "turbottest51011"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "gcp://logging.googleapis.com/projects/parker-aaa/metrics/turbottest51011"
    ],
    "title": "turbottest51011"
  }
]
✔ PASSED

POSTTEST: tests/gcp_logging_metric

TEARDOWN: tests/gcp_logging_metric

SUMMARY:

1/1 passed.

Example query results

Results
Add example SQL query results here (please include the input queries as well)

@anisadas anisadas requested a review from LalitLab April 29, 2021 15:12
@anisadas anisadas self-assigned this Apr 29, 2021
@anisadas anisadas marked this pull request as ready for review April 30, 2021 07:49
@cbruno10 cbruno10 requested review from Subhajit97 and removed request for LalitLab April 30, 2021 12:39
Copy link
Contributor

@Subhajit97 Subhajit97 left a comment

Choose a reason for hiding this comment

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

LGTM

@cbruno10 cbruno10 merged commit 97a159d into main May 4, 2021
@cbruno10 cbruno10 deleted the issue-179 branch May 4, 2021 18:06
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.

Add a column to store value of the property metricDescriptor.type in gcp_logging_metric table
3 participants