GA4 events only show up in realtime after 48 hours - google-analytics-4

I am attempting to create GA4 analytics events by POST-ing to the URL with the same details as a web app:
curl -X POST "https://www.google-analytics.com/collect?v=2&tid=<MY_TID>&cid=<MY_CID>&t=event&en=someNonsense&ep.aParameter=value&z=1234567890" -H "Content-Type: text/plain;charset=UTF-8" -H "sec-fetch-mode: no-cors" -H "sec-fetch-site: cross-site" -H "sec-fetch-dest: empty" -H "pragma: no-cache" -H "cache-control: no-cache" -H "origin: http://localhost:5000" -H "content-length: 0" -H "accept-language: en-US,en;q=0.9" -H "accept-encoding: gzip, deflate, br" -H "user-agent: dummy"
All of these events show up perfectly in the realtime view, and if I add &_dbg=1 to the URL, these events and all their parameters show up consistently and reliably in the DebugView too.
I waited 48 hours and the events didn't show up. I did the following to try to bring things to life:
added all the event parameters as custom metrics
disabled the internal traffic filter which is active by default
dug through the settings and agreed to the "Data Processing Terms"
I then waited a further 48 hours and nothing has changed. Things seem to work just fine if I do them through a browser with firebase-analytics.js.
Does anyone have any idea what I've missed/broken?
Is Google doing some post processing on events to make sure they're coming from a real web page? I can mimic the HTTPS requests of the browser and the events still wont get recorded.

I can see my events showing up in realtime on my GA4 account. Perhaps you need to debug your events using the https://ga-dev-tools.web.app/ga4/event-builder/

I've managed to get things working.
It turns out GA4 will not log events unless they are part of a session. If I send a session_start event with ga_session_number and ga_session_id properties, any subsequent events will be properly recorded for the duration of the session.

Related

VMWare REST Api - access VM host details via REST API

I'm using the VMWare REST API (/api/vcenter/host) to query information about the VM Hosts registered on a vCenter. At the moment I can only seem to get basic info like this :
{
"host": "host-10",
"name": "192.168.18.89",
"connection_state": "CONNECTED",
"power_state": "POWERED_ON"
}
but the Powershell "Get-VMHost | Format-List" has much more useful information such as ESXi version, hardware specs etc.
Can I get this kind of information via the REST API as well?
Thanks!
Yes you can get that kind of information, depending on exactly what info you are wanting. The REST API references are here that you can use to look up what you need. https://developer.vmware.com/apis/vsphere-automation/latest/
For example if you want to know what software is installed you can do something like this.
export basepw=$(echo -n 'administrator#vsphere.local:{password}' | base64)
export token3=$(curl -k -X POST -H "Authorization: Basic ${basepw}" https://{vCenterIP}/api/session/ | tr -d '"')
curl -k -X GET -H "vmware-api-session-id: ${token}" "https://{vCenterIP}/api/esx/software" -H "Content-Type: application/json" -d '{ "auth_type": "EXISTING", "host": "{host-##}"}' | jq .
It looks like vSphere 8 has more options that might fit what you want, like extracting the config https://developer.vmware.com/apis/vsphere-automation/latest/esx/settings/hosts.configuration/
From the looks, some other SDKs would be more developed that the REST API current state. Personally I like govmomi and pyvmomi and both have a CLI tool that can get you started pretty fast. The cli tool for govmomi, govc, doesn't require anything extra to run, so it is fairly portable and might help you with what you are doing.
https://github.com/vmware/govmomi
https://github.com/vmware/pyvmomi

API request on Atlas mongodb ISO 8601 granularity=Pxxx&period=Pxxx

Trying the below API request to get the CPU usage metric for last 30 days everyday at 10:30 PM.
The below command is working , But on adjusting granularity & period it is giving "errorCode" : "INVALID_PERIOD"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
curl --user "xxxxxxx:yyyyyyy" --digest
--header "Content-Type: application/json"
--include
--request GET "https://cloud.mongodb.com/api/atlas/v1.0/groups/gggggg/processes/servername:27017/measurements?m=MAX_PROCESS_CPU_USER&granularity=P1D&period=P30D&pretty=true"
On the web page https://en.wikipedia.org/wiki/ISO_8601 it is giving some formats.
I tried like &granularity=PT1H&period=P2DT1H& and more, but I am not getting the output I am looking for.
My requirement is to get the metrics at 10:30PM every day for last 30 days. Anyone know how can I pass the specific time and 30 days to get the metric out with out error.
Thanks
Thomas

Marathon doesn't deploy an app via PUT /v2/apps/{appId}

Unfortunately I face problems with deployment to Marathon.
I do curl -X PUT -H 'Content-Type: application/json' -i http://marathon_url/v2/apps/lookout -d#lookout.json
And receive response:
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Connection: close
Server: Jetty(8.y.z-SNAPSHOT)
That's it. No deploymentId returned in response.
Sometimes it needs to do around 10 curl to get an app deployed.
Sometimes I receive deploymentId, but anyway nothing changed in Marathon UI.
Marathon version: 0.9.2
Does anybody have the same problem?
PUT is for changing the config of an already deployed app. Use POST to deploy an app.

Cannot set more than one Meta data with OpenStack Swift Object

I am trying to set metadata with a Object stored in Swift Container. I am using following command (note that my container is 'container1' and object is 'employee.json':
curl -X POST -H "X-Auth-Token:$TOKEN" -H 'X-Object-Meta-metadata1: value' $STORAGE_URL/container1/employee.json
It works fine with one metadata. But whenever, I am trying to set more than one metadata issuing several curl commands, only the last metadata value is actually set.
I think, there should not be a limit that you can set only one metadata for a swift object. Am I doing anything wrong?
FYI: I am using Havana release of Openstack Swift.
Thank you.
I think, I have figured it out... Its my bad that I did not read documentation sincerely.
It [1] says, "A POST request will delete all existing metadata added with a previous PUT/POST."
So, I tried this and it worked...
curl -X POST -H "X-Auth-Token:$TOKEN" -H 'X-Object-Meta-p1:[P1]' -H 'X-Object-Meta-p2:[P1]' $STORAGE_URL/container1/employee.json
Here, instead of two POST requests, now I have set multiple metadata in a single POST request.
Again, thanks.
Ref:
http://docs.openstack.org/api/openstack-object-storage/1.0/content/update-object-metadata.html

will mongrel be blocked when uploading a huge file?

I believe that Mongrel is a single thread web server. So I suppose it will be blocked if user is uploading a huge file.
However, I did a test today, it seems not true.
I uploaded a file with curl like this:
time curl -k -F myfile=#/tmp/CGI.19974.3 -H 'LOGIN_NAME:admin' -H 'PASSWORD:pass' http://10.32.119.155:3000 -v
Here is the result:
real 6m38.756s
user 0m0.232s
sys 0m9.561s
You can see that this uploading cost 6 minutes. But during this period, the mongrel works well, it can handle the request correctly.
So, Can I say that there is another thread to handle the uploading?