atlassian-metrics's People
atlassian-metrics's Issues
Update and add docs, switch to container only demo
I'm going through the POC and adding to docs, and switching to using only docker and not local installed Prometheus.
Show examples of more JQL and example graphs with more interesting data
Maybe a section more in the readme, where we explain how to experiment with it. Make yourself a JQL, expose it as a REST and get the data in Prometheus.
Fixing missing IP numbers and removed docker-compose
- I fixed the missing .17 IPs so they match the pictures.
- I switched to not using compose, as everything isn't running from there anyway, so using plain docker is fine
- I bugfixed the
sed
command, and git-ignored prometheus.yml that will be created by our guide and shouldn't be comitted containing secrets and thus should be in git ignore.
Update readme with grafana steps for ScriptRunner data
Based on Lennards guide, the last step mising.
get_jira_issues_rest_endpoint.groovy will return the same results
Your current get_jira_issues_rest_endpoint.groovy script will return the exact same result over and over again. This is become the groovy script is compiled on initial load.
I discovered this in: https://community.atlassian.com/t5/Marketplace-Apps-questions/GET-REST-Endpoint-returning-cache-ed-results/qaq-p/899238#U899277
Therefore you need to refactor the .groovy script and move the query and results into the getStaledIssues method.
E.g.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
import org.apache.log4j.*
log.level = Level.ALL
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchProvider = ComponentAccessor.getComponent(SearchProvider)
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.transform.BaseScript
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response
@BaseScript CustomEndpointDelegate delegate
// Prometheus Format
getStaledIssues(
httpMethod: "GET", groups: ["jira-administrators"]
) { MultivaluedMap queryParams, String body ->
def query = jqlQueryParser.parseQuery("project = TIS and assignee != \"admin\" and updated <= -7d and resolution is EMPTY")
def results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())
log.debug("Total issues: ${results.total}")
return Response.ok(new String("staled_issues_count" + " " + results.total)).build()
}
This will ensure getStaledIssues() returns an updated value each time the REST endpoint is accessed.
Explain how to get the JQL data in prometheus
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.