Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

file_targets for probe options #652

Closed
xenofree opened this issue Aug 19, 2021 · 5 comments
Closed

file_targets for probe options #652

xenofree opened this issue Aug 19, 2021 · 5 comments

Comments

@xenofree
Copy link

Hi,

Is it possible or will it be possible to configure probe option through file_target like this ?

resource {
  name: "10.x.x.x"
  labels {
     key: "hostname"
     value: "xxxxxxxx"
  }
  labels {
     key: "query_type"
     value: A
  }
  labels {
     key: "resolved_domain"
     value: "xxx.xxxxxx.com"
  }
}
probe {
  name: "dns"
  type: DNS
  targets {
    file_targets {
      file_path: "/data/cloudprober/config.d/dns/targets.yml"
      re_eval_sec: 60
    }
  }
  additional_label {
      key: "hostname"
      value: "@target.label.hostname@"
  }
  additional_label {
      key: "resolved_domain"
      value: "@target.label.resolved_domain@"
  }
  dns_probe {
    query_type: @target.label.query_type@
    resolved_domain: "@target.label.resolved_domain@"
  }
  interval_msec: 60000  # 60s
  timeout_msec: 10000   # 10s
}
@manugarg
Copy link
Contributor

This should work. @xenofree, is it not working?

@xenofree
Copy link
Author

xenofree commented Aug 23, 2021

This is not working.

For query type I have this kind of issue.

  dns_probe {
    query_type: @target.label.query_type@
    resolved_domain: "@target.label.resolved_domain@"
  }
Error initializing cloudprober. Err: line 67: unexpected byte 0x40
  dns_probe {
    query_type: "@target.label.query_type@"
    resolved_domain: "@target.label.resolved_domain@"
  }
Err: line 67: invalid enum: "@target.label.query_type@"

And resolved_domain don't seems to be evaluated.

error in response ;; opcode: QUERY, status: NXDOMAIN, id: 61782
;; QUESTION SECTION:
;\@target.label.resolved_domain\@.      IN       A

@manugarg
Copy link
Contributor

Oops. Sorry, I was wrong. I missed that you were using labels in the probe config. This will not work.

It's going to be hard to implement a generic label replacement mechanism.

The way it works in HTTP probe is:

  • If "relative_url" or "host" is not defined in the probe config, and target has these labels, it automatically uses these labels.

We can do something similar for DNS probe.

@manugarg
Copy link
Contributor

@xenofree Please see the announcement here: #679. Active development of this repository is moving to github.com/cloudprober/cloudprober. Unfortunately, we'll have to close all the issues here, and file them again. Can you please do that. Thanks!

@manugarg
Copy link
Contributor

manugarg commented Nov 2, 2021

Moved here: cloudprober/cloudprober#26.

@manugarg manugarg closed this as completed Nov 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants