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

Metrics Collector: Cleanup startup logging #4953

Conversation

and-rewsmith
Copy link
Contributor

@and-rewsmith and-rewsmith commented May 6, 2021

This PR adds two things:

  • Version Information to startup
  • Cleaning up the Allowed and Blocked metrics output for the "current settings" logs

I tested this in a container and these are how the logs looked:

[2021-05-06 21:25:32 : Starting Module
[2021-05-06 21:25:33.098 INF] Initializing metrics collector
[2021-05-06 21:25:33.209 INF] Version - 1.0.0
[2021-05-06 21:25:33.215 DBG] Waiting on shutdown handler to trigger
[2021-05-06 21:25:33.303 INF] Metrics collector initialized with the following settings:
Settings:
LogAnalyticsWorkspaceId=
Endpoints=[
  "http://edgeHub:9600/metrics",
  "http://edgeAgent:9600/metrics"
]
ScrapeFrequencySecs=300
UploadTarget=IotMessage
CompressForUpload=True
TransformForIoTCentral=False
AllowedMetrics=
BlockedMetrics=
HubResourceID=subscriptions/5c2a8343-3e60-4b2c-ba7f-1498aeeed253/resourceGroups/manual-test/providers/Microsoft.Devices/IotHubs/manual-test-hub/Overview
[2021-05-06 21:25:33.514 DBG] Starting periodic operation Scrape and Upload Metrics...
[2021-05-06 21:25:33.520 INF] Scraping endpoint http://edgeHub:9600/metrics
[2021-05-06 21:25:33.581 INF] Scraping endpoint http://edgeAgent:9600/metrics
[2021-05-06 21:25:33.611 INF] Started operation Scrape and Upload Metrics
[2021-05-06 21:25:33.642 INF] Scraping finished, received 45 metrics from endpoint http://edgeHub:9600/metrics
[2021-05-06 21:25:33.643 INF] Scraping finished, received 85 metrics from endpoint http://edgeAgent:9600/metrics
[2021-05-06 21:25:34.342 INF] Successfully sent metrics via IoT message
[2021-05-06 21:25:34.343 INF] Successfully completed periodic operation Scrape and Upload Metrics

public override string ToString()
{
return this.metricList;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like this module was never integrated with our stylecop. Now whenever I make changes it gets auto-formatted to the correct format.

The autoformatting is making it hard to tell what I added, but I added this ToString() method and this instance variable. This is necessary so that when we print the configuration the module is starting with, it shows in some meaningful format rather than just the class name.

@and-rewsmith and-rewsmith changed the title Metrics Collector: Add version information logging to startup Metrics Collector: Cleanup startup logging May 6, 2021
@and-rewsmith and-rewsmith marked this pull request as ready for review May 6, 2021 21:32
@and-rewsmith and-rewsmith requested a review from veyalla May 6, 2021 21:33
@and-rewsmith and-rewsmith merged commit 69110c1 into Azure:release/1.1 May 7, 2021
darobs pushed a commit to darobs/iotedge that referenced this pull request May 26, 2021
darobs added a commit that referenced this pull request May 26, 2021
* Update the KeyVault for Test pipelines (#4937)

* Metrics Collector: Remove test-specific additional tags logic (#4950)

* Metrics Collector: Add gzip compression in the iot message scenario (#4955)

* E2E: Metrics Collector Smoke Test (#4945)

* Metrics Collector: Cleanup startup logging (#4953)

* Metrics Collector: Update product info and message id (#4962)

* Metrics Collector: Rename HubResourceId -> ResourceId (#4956)

* Adds SharedAccessSignature to repo with fix for vulnerability (#4943) (#4967)

* Metrics Collector: Release and publish pipelines (#4969)

* Close AMQP connection explicitly when no more links (removing links kept tcp level connection) (#4984)

* Update `GetModuleLogs` method when `tail + since + until` options are provided (#4987)

* Introduce `Timestamps` Option via mgmt.sock  (#4988)

* Cherry-pick to Release/1.1: Fix edgehub queue len metric (#4952) (#4990)

* Update Base Images for Security Patch (#4994)

* Update v1.1 YAML pipelines to 1ES-hosted agents (#4844)

* Fix potential instability in iotedged after UploadSupportBundle fails (#4942)

* Rename end-to-end test log artifacts (#5006)

* Merge Prometheus parser fix. (#5007)

* Prepare for Release 1.1.3 (#5008)

* Fixing diagnostics image for 1.1 (#5018)

* Prepare for Release1.1.3 (part 2) (#5020)

* Remove PII from log. (#5022)

Co-authored-by: yophilav <54859653+yophilav@users.noreply.github.com>
Co-authored-by: Andrew Smith <als5ev@virginia.edu>
Co-authored-by: Robert T Jang <robbaldwin95@gmail.com>
Co-authored-by: vipeller <51135538+vipeller@users.noreply.github.com>
Co-authored-by: Damon Barry <damonbarry@users.noreply.github.com>
Co-authored-by: Pedro Marcelo Zara <pmzara@hotmail.com>
Co-authored-by: dylanbronson <55515325+dylanbronson@users.noreply.github.com>
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.

None yet

2 participants