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

Test runs should not fail if it's not possible to extract prometheus data #1267

Closed
davidkel opened this issue Mar 13, 2022 · 1 comment · Fixed by #1288
Closed

Test runs should not fail if it's not possible to extract prometheus data #1267

davidkel opened this issue Mar 13, 2022 · 1 comment · Fixed by #1288
Assignees
Labels
bug Something isn't working component/core Related to the core code-base
Milestone

Comments

@davidkel
Copy link
Contributor

davidkel commented Mar 13, 2022

In the case of prometheus we can specify a monitor to extract data from prometheus, however if prometheus isn't available you get

Error: connect ECONNREFUSED 127.0.0.1:9090
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
Emitted 'error' event on ClientRequest instance at:
    at Socket.socketErrorListener (_http_client.js:475:9)
    at Socket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 9090
}

And caliper terminates.

This is really annoying because now I can't use a benchmark which defines a monitor for prometheus if I choose not to have prometheus running.

It should not fail the run, just report a warning or at least have an option that stops it from failing the run

@davidkel davidkel added enhancement New feature or request component/core Related to the core code-base labels Mar 13, 2022
@davidkel davidkel added this to the v0.5.0 milestone Mar 19, 2022
@davidkel davidkel self-assigned this Mar 22, 2022
@davidkel
Copy link
Contributor Author

there is no issue with a docker monitor and it also looks like from the code that if an attempt to push data to a prometheus push gateway fails then it will just log it, so I think that this is more of a bug than an enhancement, so changing to bug. The only thing is that from an integration test point of view if for some reason it is supposed to work but doesn't (eg url is wrong and so prometheus is not found) then the build would still pass.

@davidkel davidkel added bug Something isn't working and removed enhancement New feature or request labels Mar 23, 2022
@davidkel davidkel changed the title test runs should have the option to not fail if a monitor can't connect to an external port Test runs should not fail if it's not possible to extract prometheus data Mar 23, 2022
davidkel pushed a commit to davidkel/caliper that referenced this issue Mar 24, 2022
This is due to the error event not being correctly captured when a
request is made to prometheus

Also added some extra code to output a warning and stop trying to do any
more queries for the round.

It won't stop it for all rounds but checks on every round.

closes hyperledger-caliper#1267
davidkel pushed a commit to davidkel/caliper that referenced this issue Mar 24, 2022
This is due to the error event not being correctly captured when a
request is made to prometheus

Also added some extra code to output a warning and stop trying to do any
more queries for the round.

It won't stop it for all rounds but checks on every round.

closes hyperledger-caliper#1267

Signed-off-by: D <[email protected]>
davidkel added a commit that referenced this issue Mar 24, 2022
This is due to the error event not being correctly captured when a
request is made to prometheus

Also added some extra code to output a warning and stop trying to do any
more queries for the round.

It won't stop it for all rounds but checks on every round.

closes #1267

Signed-off-by: D <[email protected]>

Co-authored-by: D <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component/core Related to the core code-base
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant