Giter Club home page Giter Club logo

Comments (3)

powersj avatar powersj commented on June 21, 2024

hi @yockgen,

Can you point to the API endpoint for alerts you are trying to use? There is support for creating tasks.

from influxdb-client-go.

yockgen avatar yockgen commented on June 21, 2024

hi @yockgen,

Can you point to the API endpoint for alerts you are trying to use? There is support for creating tasks.

Hi @powersj,
Thanks for the info! I'm trying to find information on how to use "influx-client-go" to do something like below (to create CHECKS/Endpoint/Rules for Alert):

curl -X POST "http://10.49.76.106:32701/api/v2/checks" \
-H "Authorization: Token  xxxxxxx" \
-H "Content-Type: application/json" \
-d '{
  "name": "Testing 01",
  "type": "threshold",  
  "query": {
    "text": "from(bucket: \"intel\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"mem_available_percent\")\n  |> filter(fn: (r) => r[\"_field\"] == \"gauge\")\n  |> filter(fn: (r) => r[\"host\"] == \"node01\")\n  |> aggregateWindow(every: 1m, fn: last, createEmpty: false)\n  |> yield(name: \"last\")",
    "editMode": "builder",
    "name": "",
    "builderConfig": {
      "buckets": ["company"],
      "tags": [
        {
          "key": "_measurement",
          "values": ["mem_available_percent"],
          "aggregateFunctionType": "filter"
        },
        {
          "key": "_field",
          "values": ["gauge"],
          "aggregateFunctionType": "filter"
        },
        {
          "key": "host",
          "values": ["3214261f-3ee2-1169-841c-1c697aa4038c"],
          "aggregateFunctionType": "filter"
        }
      ],
      "functions": [
        {
          "name": "last"
        }
      ],
      "aggregateWindow": {
        "period": "1m",
        "fillValues": false
      }
    }
  },
  "every": "5m",
  "offset": "30s",  
  "status": "active",
  "description": "My check description",
  "labels": ["label1", "label2"],
  "message": "Check triggered",
  "orgID": "xxxxxxx"
}'

Thanks of your guidance!

from influxdb-client-go.

powersj avatar powersj commented on June 21, 2024

@bednar does this library expose anything for the /api/v2/checks endpoint? Quick search doesn't seem to show it.

from influxdb-client-go.

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.