8000 feat(expressions): document matchexpression jfrEventTypeIds function by andrewazores · Pull Request #210 · cryostatio/cryostatio.github.io · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(expressions): document matchexpression jfrEventTypeIds function #210

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions guides/_subsections/create-an-automated-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,17 @@ Previously, if we wanted to enable always-on `Continuous` monitoring using **JDK
{% endhighlight %}
</figure>
<p>
The <i>alias, connectUrl, labels, annotations.platform,</i> and <i>annotations.cryostat</i> properties are all guaranteed to be present on the <code>target</code> object. <i>alias</i> and <i>connectUrl</i> will be non-empty strings. The <i>jvmId</i> is a hash string computed by Cryostat after it successfully connects to a <code>target</code> <b>JVM</b> and is used to uniquely identify that <b>JVM</b> instance - it will be empty if <b>Cryostat</b> has not yet connected to that <code>target</code> (for example, if its <a href="#add-a-trusted-certificate"><code>SSL/TLS</code> certificate is not trusted</a> or if <a href="#store-credentials"><b>Cryostat</b> is missing the required credentials</a>) The <i>labels</i> and <i>platform annotations</i> may be empty — in <b>OpenShift</b> or <b>Kubernetes</b>, these are populated from the labels and annotations applied to the <code>target</code>’s pod, if any. The <b>Cryostat</b> annotations map will vary per platform, but on <b>OpenShift</b> or <b>Kubernetes</b> you can expect the <i>HOST, PORT, NAMESPACE,</i> and <i>POD_NAME</i> keys to be present and non-empty. Take care to use the `has` or `in` operators when dealing with the <i>labels</i> and <i>annotations</i> map structures where specific keys may not exist.
8429
The <i>alias, connectUrl, labels, annotations.platform,</i> and <i>annotations.cryostat</i> properties are all guaranteed to be present on the <code>target</code> object. <i>alias</i> and <i>connectUrl</i> will be non-empty strings. The <i>jvmId</i> is a hash string computed by Cryostat after it successfully connects to a <code>target</code> <b>JVM</b> and is used to uniquely identify that <b>JVM</b> instance - it will be empty if <b>Cryostat</b> has not yet connected to that <code>target</code> (for example, if its <a href="#add-a-trusted-certificate"><code>SSL/TLS</code> certificate is not trusted</a> or if <a href="#store-credentials"><b>Cryostat</b> is missing the required credentials</a>) The <i>labels</i> and <i>platform annotations</i> may be empty — in <b>OpenShift</b> or <b>Kubernetes</b>, these are populated from the labels and annotations applied to the <code>target</code>’s pod, if any. The <b>Cryostat</b> annotations map will vary per platform, but on <b>OpenShift</b> or <b>Kubernetes</b> you can expect the <i>HOST, PORT, NAMESPACE,</i> and <i>POD_NAME</i> keys to be present and non-empty. Take care to use the <code>has</code> or <code>in</code> operators when dealing with the <i>labels</i> and <i>annotations</i> map structures where specific keys may not exist.
</p>
<p>
The <code>Expression</code> also has a <code>jfrEventTypeIds</code> function in global scope, which takes the <code>target</code> object as a parameter and returns a list of <code>string</code>s corresponding to the <b>Flight Recorder Event Types</b> registered in the <code>target</code> <b>JVM</b>.
</p>
<figure>
{% highlight typescript %}
jfrEventTypeIds(target: Target): string[];
{% endhighlight %}
</figure>
<p>
Here are some examples of <code>Match Expressions</code>:
</p>
<figure>
Expand All @@ -105,6 +114,8 @@ has(target.annotations.cryostat.PORT) && 'io.kubernetes/annotation' in target.an
!('io.kubernetes/annotation' in target.annotations.platform)

target.alias.matches("^customer-login[0-9]\*$")

jfrEventTypeIds(target).exists(t, t.startsWith('myorg.myapp.'))
{% endhighlight %}

</figure>
Expand Down
0