Skip to content

0.4.0 / 2025-03-22

Compare
Choose a tag to compare
@peekjef72 peekjef72 released this 22 Mar 16:57
· 11 commits to 1c18f1f7db7c0e8700953db8ca45a214aa965089 since this release

2025-03-19 - not release

  • bugfixed: synchronization error between target and collectors replies. target may stayed in infinite wait for collectors that had send replies too early in process (gofunc() channel synchro pb)
  • added: debug messages (to track previous bug)
  • fixed: json reponse format for /reload
    • {"message":"ok","status": 1,"data": {"reload": true}}

2025-03-16 - not release

  • added: parser 'prometheus' that can interact with data returned by an exporter.
  • added: documentation for parsers.
  • fixed: debug message

2025-03-03 - not release

  • added: parsers 'yaml' and 'text-lines' (split result into lines after "\r?\n"). See documentation parsers for more infos.
  • added: template function "exporterRegexExtract" to obtain matching group from regex and searching string: [array] <= exporterRegexExtract[regexp] [search_string]
  • added: some gotest for exporter template function.

2025-02-17

  • fixed: json reponse format for /status and /loglevel
    • {"message":"ok","status": 1,"data": {"status":"ok"}}
    • {"message":"ok","status": 1,"data": {"loglevel": "<loglevel>"}}

2025-01-15

  • fixed: changed --dry-run command line flag behavior when no target specified: only check config; do not try to collect first available target.

  • added: disable_warn: true|false in auth_config to disable warning messages from RESTY if auth is basic and connection is http.

      auth_config:
        mode: basic
        user: ping
        password: ping
        disable_warn: true

2025-01-11

  • fixed: config output in json format.
  • fixed: warn messages ("script_name not defined"), displayed with loglevel "debug"

2025-01-08

  • fixed: now checks that each target has at least one collector defined; e.g.: failed if collector pattern matching doesn't correspond to any collector name.
  • fixed: allow "scope" directive to use $var_name format (like .var_name).

2025-01-04

  • added "profile" for config and target. Now exporter can collect multiple apis with different "login" semantics. Before the config contains only one httpapi_config part that may define the "clear", "init", "login", "logout", "ping" scripts. The new version allows to define "profiles", and in each profile the "default scripts", so that a target can use a named profile :

    profiles:
      default:
          # all metrics will be named "[metric_prefix]_[metric_name]"
          metric_prefix: "apiprefix"
    
          scripts:
            init:
              - name: default headers
                set_fact:
                  scheme: https
                  base_url: /my_url...
                  verifySSL: true
                  headers:
                    "Content-Type": application/json
                    Accept: "application/json"
            login: ~
            logout: ~
    
            # method call to determine if a target is responding; will call login() if necessary
            ping:
              - name: check if API is replying
                query:
                  url: my_ping_url
                  ...

    Alternatively it is possible to add profiles via profile files with profiles_file_config directive: set a list of filepath accepting wildcards '*' (golang filegob ()) to "profiles". The content of each file must be a profile_config (see above or contribs)

      profiles_file_config:
        - "*_profile.yml"

    Then each target may set a profile name to use; by default if not set, the exporter will try to assign the profile "default" or the only one if there is only one profile defined in configuration, else the config check will failed.
    Each profile, may also set a "metric_prefix", so that "up", "collector_status", "scrape_duration" metrics have a distinct name for each profile!

2024-12-14

  • added: parameter "health" to endpoint "/metrics", so that only "ping" script is performed and the metrics "up" with status returned. May be usefull to check if a target is responding; I use this feature in ansible playbook before to generate "file_sd_config" of scraping job for prometheus.

  • added: parsers feature to decode response in the query action. parser can be:

    • xml for "text/xml" content : beta ; feedbacks are appreciated.
    • json default parser. Before 0.4.0 all replies must be in json format.
    • none for reponse that you don't want to parse (landing ping() page by example.)
    • openmetrics not implemented yet!

    httpapi_exporter can now provide unified results for multi-format api. I've got one that respond with both json and xml data.
    usage:

      - name: collect elements
      query:
        url: /path/entrypoint
        var_name: results
        # debug: yes
        parser: xml
    
  • fixed access to url without authentication (no user, password provided with defaut basic authentication). Removed the header generation (Authorization).

  • allow dynamic metric name and help. Now it is possible to define metrics in a loop:

    - metric_name: "config_{{ .counter.name }}"
      help: "parameter {{ .counter.value }} is enabled boolean (0: false - 1: true)"
      type: gauge
      key_labels: $labels
      values:
        _: "{{ convertBoolToInt .counter.value }}"
      loop:
        - name: hasAdvancedDocumentConversion
          value: $results.hasAdvancedDocumentConversion
        - name: hasAdvancedQueryReporting
          value: $results.hasAdvancedQueryReporting
      loop_var: counter

    that will produce:

    # HELP exalead_license_config_hasAdvancedDocumentConversion parameter false is enabled boolean (0: false - 1: true)
    # TYPE exalead_license_config_hasAdvancedDocumentConversion gauge
    exalead_license_config_hasAdvancedDocumentConversion{company="My Company",param="hasSemanticFactory",type="-"} 0
    # HELP exalead_license_config_hasAdvancedQueryReporting parameter false is enabled boolean (0: false - 1: true)
    # TYPE exalead_license_config_hasAdvancedQueryReporting gauge
    exalead_license_config_hasAdvancedQueryReporting{company="My Company",param="hasSemanticFactory",type="-"} 0
    

    this example is a lilte bit stupid, because it is more accurate to add a label param with name of parameter in config metric, but it explains how it can work !

  • add new template function convertBoolToInt to convert text boolean to value 0 or 1.

    • string "true", "yes", "ok" returns 1 anything else 0.
    • any int or float value distinct of 0 then 1 else 0.
    • map,slice: if length of map or slice is greater than 0 then 1 else 0.
  • add contribs exalead exporter.

  • add config parameters in configuration file in global section for:

    • web.listen-address (priority to config file over command line argument --web.listen-address)
    • log.level (priority to config file over command line argument --log.level)
    • up_help allow user to replace default help message for metric help (default is "if the target is reachable 1, else 0 if the scrape failed")
    • scrape_duration_help same for scrap duration metric (default is "How long it took to scrape the target in seconds")
    • collector_status_help same for collector status (default is "collector scripts status 0: error - 1: ok - 2: Invalid login 3: Timeout")