Giter Site home page Giter Site logo

pipeline-common-scripts's Introduction

Summary

This repo contains reference scripts for use integrating Dynatrace into software delivery pipelines.

Please share feedback and your examples with a Pull Request or to me @ [email protected]

Events

In just a few steps, you can add Dynatrace Events API for things like deployments, performance tests, or configuration changes. In doing so, your development and operations teams have additional context information during review and analysis of your applications.

Read more in my Dynatrace blog

Scripts

PowerShell

  • azureDevopsCaptureStartTime.ps1 - save current time to environment variable
  • azureDevopsCaptureEndTime.ps1 - save current time to environment variable
  • azureDevopsCustomEvent.ps1 - add Dynatrace CUSTOM_INFO event
  • azureDevopsDeploymentEvent.ps1 - add Dynatrace CUSTOM_DEPLOYMENT event

Unix Shell

  • bitbucketPushEvent.sh - push events from one script. Used bitbucket built-in vars for various properties in the event
  • dynatrace-deployment-event.sh - add Dynatrace CUSTOM_DEPLOYMENT event
  • dynatrace-push-event.sh - add misc events from on script. Modify for your CI/CD tool
  • test-keptn-quality-gate.sh - used to test [http://keptn.sh](Keptn Quality Gate)
  • send-traffic.sh - simple script to send load with request attributes
  • wait-till-ready.sh - simply script to add after a deployment event

Local testing

In the testing/ folder are a few "wrapper" scripts that can be used to test these scripts. Just make a copy of the template file. You can update with your testing input. If you keep the prefix of test, the .gitinore file will ensure you dont check in any secrets.

pipeline-common-scripts's People

Contributors

robertjahn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pipeline-common-scripts's Issues

Tag values not found despite service being tagged

I tried to execute the script azureDevopsDeploymentEvent , ended up with the below error.

Invoke-RestMethod : {"error":{"code":400,"message":"Invalid attachRules object
2020-04-20T08:01:58.2086317Z ##[error]PowerShell exited with code '1'.
2020-04-20T08:01:58.2096445Z provided. No MEIdentifier do match: Matching rule:
2020-04-20T08:01:58.2115242Z PushEventAttachRules{entityIds=null, tagRules=[TagMatchRule{meTypes=[SERVICE],
2020-04-20T08:01:58.2115339Z tags=[[CONTEXTLESS]environment:dynatrace, [CONTEXTLESS]service:approvals]}]}"}}

I have tagged the service appropriately attached is the screengrab of the service .
approvaltags

Scripts outdated causing issues with tokens

I noticed that the scripts are a bit outdated as it doesn’t refer in all scripts to the events v2 but to the V1 causing issues with the required token scope according to the Dynatrace documentation. Some of the scripts have been modified but some not. Perhaps a good idea to update all of them and create a new branch?

Kind regards,

Daan

Start and end times not matching up with Dynatrace event times

The following time formats didn't work for me:

$startTime = Get-Date -UFormat %s

$endTime = Get-Date -UFormat %s

Here is what worked for me: [DateTimeOffset]::Now.ToUnixTimeSeconds()

Notes
*The difference between what Get-Date -UFormat %s and what [DateTimeOffset]::Now.ToUnixTimeSeconds() return is 21600 seconds
*The issue may be that I was running on a Windows based build agent and/or there is something up with the GMT offset

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.