How to receive Event Key value from Bitbucket to Jenkins Multibranch Pipeline using Bitbucket Server Integration plugin - jenkins-pipeline

I installed the plugin Bitbucket Server Integration in jenkins & able to receive webhook to trigger build jobs with this setup.
From the logs also I can see different event key is received.
Processed 4 branches (query complete)
[Mon Jan 16 13:23:53 IST 2023] com.atlassian.bitbucket.jenkins.internal.trigger.BitbucketWebhookConsumer$BitbucketSCMHeadPullRequestEvent UPDATED event from code-repository with timestamp Mon Jan 16 13:23:52 IST 2023 processed in 0.55 sec
[Mon Jan 16 16:23:04 IST 2023] Received com.atlassian.bitbucket.jenkins.internal.trigger.BitbucketWebhookConsumer$BitbucketSCMHeadEvent UPDATED event from code-repository with timestamp Mon Jan 16 16:23:04 IST 2023
git rev-parse --resolve-git-dir /var/lib/jenkins/caches/git-deb6ea23f7071e9d585c1b40bdf92144/.git
Now I want to perform different actions based on the received eventKey. Like doing extra validation if received event is for a Pull Request.
I understand we can read the JSON payload for the webhook trigger (from ${JENKINS_URL}/bitbucket-server-webhook/trigger). There is also a way to read it from Request Header: X-Event-Key.
Bitbucket Webhook request
But I cannot find a way to read/print it in Jenkins console.
Can anyone help with it please?

Related

Can the istio log output time zone be modified?

[2020-11-27T03:53:09.046Z] "HEAD /productpage HTTP/1.1" 200 - "-" 0 0 27 27 "10.244.11.0" "curl/7.47.0" "ef48c206-422a-9d0d-ac56-9be531b190f7" "10.22.24.5:31695" "10.244.6.18:9080" outbound|9080||productpage.istio-web.svc.cluster.local 10.244.6.251:41376 10.244.6.251:8080 10.244.11.0:54697 - -
How to change istio log time zone to 'Asia/Shanghai'?
This topic has already been discussed on envoy github as istio uses envoy access log.
As far as I know currently it's not possible. There are github issues I mentioned above about that which says that it's designed in UTC by default.
Access log's timestamps are still in UTC regardless a containter's timezone
How to change the log time zone of each component of Istio to CST format
It's not even possible to persuade the image to use your timezone as envoy will use the UTC anyway.

Cadence cron schedule according to timezone

What is the timezone used by cadence by default?
How can we change cron expression according to timezone? eg if a user enters a cron schedule from a different timezone than the cadence's server timezone let say the user enters 1 pm every day in GMT + 5 then it should run at 9 am in the server( assuming cadence's server timezone is GMT only ).
I am using golang cadence client to write the workflows.
Any help is appreciated.
You'll have to rewrite the cron expression yourself before passing it to Cadence. Consider using an existing library like cron-utils for this.

"Missing application logs in drains Heroku Status #1372"

What does this mean? It's just a warning on my Heroku metrics dashboard and isn't seemingly affecting me in a negative way, but I'm worried it's secretly messing with something?
The Heroku Status Twitter account has 3 tweets starting yesterday regarding this incident. The incident began 2 days ago (January 10th as of this writing) as the bottom of the page says:
Issue
From 18:48 UTC (1:48 PM ET) we have been experiencing losses in log drains.
Application log drains (add-ons and custom drains to external services) may have missing log lines.
During this incident, heroku logs --tail can be used to monitor incoming logs and should not have missing log lines. This output can be redirected to a file for later use if desired: heroku logs --tail > /tmp/.log
POSTED 2 DAYS AGO, JAN 10, 2018 20:22 UTC
It might affect you in a negative way if you rely on application logs for further analysis and record keeping.

influxdb and grafana timezone mismatch

I'm trying to use curl to write datapoints into to influxdb and then display with grafana.
The following successfully writes to influxdb, but the time is in UTC
# curl -i -XPOST "http://localhost:8086/write?db=db_fio" --data-binary "test result=22"
HTTP/1.1 204 No Content
Request-Id: a333902d-7c69-11e5-802d-000000000000
X-Influxdb-Version: 0.9.4.1
Date: Tue, 27 Oct 2015 05:14:45 GMT
# date
Mon Oct 26 22:17:40 PDT 2015
When I try to display the datapoints in grafana I can not as they are in the future for my timezone (PDT), even thought both services are running on the same server.
What am I doing wrong? How do I get grafana and influxdb to be on the same time?
You can set UTC timezone per dashboard.
http://play.grafana.org/dashboard/db/new-features-in-v20?editview=settings
InfluxDB only supports UTC. There is no way to write or query points in any other timezone. The feature request for timezone support describes some of the challenges that make this a difficult feature to implement.
I am not familiar enough with Grafana to know if it can do timezone translation on the results from InfluxDB.

Process Engine Dispatcher exception while transferring the workflow

When a workflow is being transferred the PE error occurred. I am using custom components other than CE_Operations in workflow.
ERROR STACK:
[FATAL 09 Apr 2014 15:25:21] Dispatcher got exception while doing query at April 9, 2014 3:25:21 PM GMT+05:30. Cause=[FNRPE2131090092E]The work space time stamp is stale
The work space has been updated by transfer, so the client workstation needs to load new workspaces and a new time stamp.
at filenet.pe.peorb.client.ORBUtility.mapServerException(ORBUtility.java:529)
at filenet.pe.peorb.client.ORBSession.executeRPC(ORBSession.java:1266)
at filenet.pe.peorb.client.ORBSession.fetch(ORBSession.java:2112)
at filenet.vw.api.VWQuery.fetch(VWQuery.java:653)
at filenet.vw.api.VWQueueQuery.dofetch(VWQueueQuery.java:429)
at filenet.vw.api.VWQuery.hasNext(VWQuery.java:768)
at filenet.vw.api.VWQueueQuery.hasNext(VWQueueQuery.java:461)
at filenet.vw.integrator.base.VWAdaptorControlEx$WorkflowDispatcher.run(VWAdaptorControlEx.java:359)
Root Cause:
[FNRPE2131090092E]The work space time stamp is stale
The work space has been updated by transfer, so the client workstation needs to load new workspaces and a new time stamp.
at filenet.jpe.server.common.IVWRuntimeServer.checkTimeStamps(IVWRuntimeServer.java:4754)
at filenet.jpe.server.common.IVWRuntimeServer.InitSession(IVWRuntimeServer.java:4064)
at filenet.jpe.rpc.orb.OrbRPC.<init>(OrbRPC.java:696)
at filenet.jpe.rpc.orb.ORBPERPC.orb_rpc_fetchQuery(ORBPERPC.java:911)
at filenet.pe.peorb.FileNet_PERPC.PERPCPOA._invoke(PERPCPOA.java:697)
at com.ibm.CORBA.poa.POAServerDelegate.dispatchToServant(POAServerDelegate.java:402)
at com.ibm.CORBA.poa.POAServerDelegate.internalDispatch(POAServerDelegate.java:334)
at com.ibm.CORBA.poa.POAServerDelegate.dispatch(POAServerDelegate.java:256)
at com.ibm.rmi.iiop.ORB.process(ORB.java:518)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:1574)
at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2880)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2753)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:63)
at com.ibm.rmi.iiop.WorkerThread.run(ThreadPoolImpl.java:202)
at java.lang.Thread.run(Thread.java:736)
How can I resolve this issue. Thanks!
Check the configuration of your connection point
to make sure it work :
run (install dir)FileNet\AE\Router\routercmd.bat
click on connection point, in the right panel under general tab clic on buton "display work queue"
-> this action try a connection from AE to PE, to retrieve names of your work queues.
if it work your connection point should be working
if not, see vwtaskman.log under (install dir)FileNet\AE\Router\ for more details

Resources