Git Product home page Git Product logo

ehm's People

Contributors

veyalla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ehm's Issues

Fails on Raspberry Pi

I've setup IoT Edge and I cannot make metricscollector to work there. Container fails with following error:

standard_init_linux.go:211: exec user process caused "exec format error"

My suspicion is that docker image should be build against different architecture. Is that correct?

Board: Raspberry Pi 3 Model B Rev 1.2
OS: Raspbian GNU/Linux 9 (stretch)
Docker version 3.0.13+azure, build dd360c7c0de8d9132a3965db6a59d3ae74f43ba7
iotedge 1.0.9.3
container: veyalla/metricscollector:0.0.4-amd64
uname-m: armv7l

MetricsCollector module should react to device twin changes

Expected Behavior

If the device twin is changed, means the scraped prometheus endpoints chance, e.g. because a new module is added, the MetricsCollector module should recognize that.

Current Behavior

At the moment the MetricsCollector just evaluates it's device twin on start-up.

Steps to Reproduce

Provide a detailed set of steps to reproduce the bug.

  1. Deploy MetricsCollector module
  2. Add another edge module exposing a prometheus endpoint
  3. Add the prometheus endpoint to the endpoints-list of the MetricsCollector device twin
  4. Note that the new endpoint is not scraped

Additional Information

Please note that the current behaviour basically mean you have to stop/start the MetricsCollector every time the list of prometheus endpoints changes. This is very inconvenient if you have no direct access to the edge and are forced to do two deployments via the Azure portal just to stop and start the MetricsCollector module in order to refresh the prometheus endpoint list.

Please also add some guidance how to sync via IoTHub

Many thanks for providing the possibility to sync IoT edge metrics in some standard way (this was exactly the feature we have missed so far) to the cloud. It works as expected with the direct sync to log analytics - however I also want to try out the support of offline/disconnected scenarios and so I would also like to test the way to sync via IoTHub/D2C messages.

Since it was a pleasure to follow your guide to implement the log analytics connection, I would like to ask to also add some similar guidance for the D2C-way.

Thanks in advance!

Metrics Collector Module Fails with Invalid logs uploaded request schema

Unhandled Exception: System.AggregateException: One or more errors occurred. (Invalid logs upload request schema version ) ---> System.InvalidOperationException: Invalid logs upload request schema version
at MetricsCollector.SchemaVersionHelper.CompareMajorVersion(Version expectedVersion, String actualVersionString, String context) in /app/SchemaVersionHelper.cs:line 11
at MetricsCollector.Program.GetConfiguration(ModuleClient ioTHubModuleClient) in /app/Program.cs:line 105
at MetricsCollector.Program.Init() in /app/Program.cs:line 52
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at MetricsCollector.Program.Main(String[] args) in /app/Program.cs:line 22

Create Container Options set :

{
"properties.desired": {
"schemaVersion": "1.0",
"scrapeFrequencySecs": 300,
"metricsFormat": "Json",
"syncTarget": "AzureLogAnalytics",
"endpoints": {
"edgeHub": "http://edgeHub:9600/metrics"
}
}
}

Any advise?

Metrics collector fails when sending data on windows

In order to evaluate the use of Edge Hub Metrics for our project, I tried to set up IoT Edge devices on VMs for Linux (with Linux Containers) and Windows (with Windows Containers). While the Linux version worked just fine, I keep having problems with the windows version. My setup is:

  • A Windows 10 Hyper-V VM
  • Azure IoT Edge Release 1.0.9 installed with Windows Containers
  • Edge Agent and Edge Hub modules using tag 1.0.9-rc6
  • ExperimentalFeatures__Enabled and ExperimentalFeatures__EnableMetrics set to true
  • EdgeHub using these create options

{ "HostConfig": { "PortBindings": { "443/tcp": [ { "HostPort": "443" } ], "5671/tcp": [ { "HostPort": "5671" } ], "8883/tcp": [ { "HostPort": "8883" } ] } }, "User": "ContainerAdministrator", "ExposedPorts": { "9600/tcp": {}, "5671/tcp": {}, "8883/tcp": {} } }

  • The MetricsCollector module installed using tag 0.0.5-windows-amd64 and with this twin:

{ "schemaVersion": "1.0", "scrapeFrequencySecs": 10, "metricsFormat": "Json", "syncTarget": "IoTHub", "endpoints": { "edgeAgent": "http://edgeAgent:9600/metrics", "edgeHub": "http://edgeHub:9600/metrics" } }

While the collector seems to be able to retrieve the metrics from the edgeAgent and edgeHub, it fails to send them to IoT Hub. I tried around if it might be some connectivity issue from my VM, but for example the simulated temperature sensor module succeeds to send telemetry to IoT Hub. The error message that I get is:

Scraping endpoint http://edgeAgent:9600/metrics
Got metrics from endpoint [http://edgeAgent:9600/metrics, http://172.23.15.202:9600/metrics]
Scraping endpoint http://edgeHub:9600/metrics
Got metrics from endpoint [http://edgeHub:9600/metrics, http://172.23.13.128:9600/metrics]
Error scraping and syncing metrics - System.InvalidOperationException: Operation is not valid due to the current state of the object.
at Microsoft.Azure.Amqp.AmqpMessage.get_DataBody()
at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpIoTSendingLink.SendMessagesAsync(IEnumerable1 messages, TimeSpan timeout) at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.SendMessagesAsync(IEnumerable1 messages, TimeSpan timeout)
at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.SendEventsAsync(IEnumerable1 messages, TimeSpan timeout) at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpTransportHandler.SendEventAsync(IEnumerable1 messages, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass22_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func1 asyncOperation) at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass15_0.<<SendEventAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.SendEventAsync(IEnumerable1 messages, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Client.InternalClient.SendEventBatchAsync(IEnumerable`1 messages)
at MetricsCollector.IoTHubMetricsSync.ScrapeAndSync() in C:\app\IoTHubMetricsSync.cs:line 30

Any ideas? I know that the metrics collector is no officially supported module - we didnt plan to use it in production, just for evaluating the edge hub metrics features for our project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.