Giter Site home page Giter Site logo

Comments (2)

Lawouach avatar Lawouach commented on May 30, 2024

Hello!

I think the read_pod_logs probe doesn't return a boolean so the tolerance would be incorrect. Maybe use a jsonpath or regex instead?

for instance:
https://docs.chaostoolkit.org/reference/tutorials/tolerance/#validate-the-stdoutstderr-of-a-process

from chaostoolkit-kubernetes.

SidGrundfos avatar SidGrundfos commented on May 30, 2024

Thanks for the help!
I have added something like this
{
"name": "fetch-guamapper-pod-logs",
"type": "probe",
"tolerance": {
"type": "regex",
"pattern": "@timestamp",
"target": "stdout"
},
"provider": {
"func": "read_pod_logs",
"arguments": {
"name": "guamapper",
"last": "30m",
"ns": "core"
},
"type": "python",
"module": "chaosk8s.pod.probes"
}
}

where the logs I should receive from kubectl is similar to -
{"@timestamp":"2020-02-25T07:27:30.7609245Z","Message":"Deleted Source blob "51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0#2020-02-25T07-29-55Z.json.gz" From Container.","BlobName":"51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0#2020-02-25T07-29-55Z.json.gz","SourceContext":"Grundfos.GiC.ZipTranslatorService.Services.BlobFileOperations.BlobOperationManager"}

{"@timestamp":"2020-02-25T07:27:30.8889674Z","Message":"Marked file upload notification as complete:DeviceId:"51558226fb58524ca6b3137c150e308f",BlobName: "51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0#2020-02-25T07-29-55Z.json.gz", BlobUrl:"https://gfstoiotfileuploadpazwe.blob.core.windows.net/wwnfiles/51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0%232020-02-25T07-29-55Z.json.gz\", BlobSizeInBytes:7156, LastUpdatedTime:02/25/2020 07:27:26 +00:00, EnqueuedTimeUtc:02/25/2020 07:27:28","Level":"Verbose","DeviceId":"51558226fb58524ca6b3137c150e308f","BlobName":"51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0#2020-02-25T07-29-55Z.json.gz","BlobUri":"https://gfstoiotfileuploadpazwe.blob.core.windows.net/wwnfiles/51558226fb58524ca6b3137c150e308f/02060001053ACC5A_10_0%232020-02-25T07-29-55Z.json.gz","BlobSizeInBytes":7156,"LastUpdatedTime":"2020-02-25T07:27:26.0000000+00:00","EnqueuedTimeUtc":"2020-02-25T07:27:28.1185446Z","SourceContext":"Grundfos.GiC.ZipTranslatorService.ZipTranslator"}

where I am searching for "timestamp"

the Pod Yaml contains labels -
labels:
app.kubernetes.io/environment: p
app.kubernetes.io/instance: guamapper
app.kubernetes.io/name: guamapper
pod-template-hash: 574f89f4cd

Am I missing something? Or is there a syntax error, I am looking for last 30 minutes logs

It gives an error -
File "/opt/hostedtoolcache/Python/3.8.1/x64/lib/python3.8/site-packages/chaoslib/hypothesis.py", line 304, in _
return rx.search(value) is not None
TypeError: expected string or bytes-like object

from chaostoolkit-kubernetes.

Related Issues (20)

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.