I use the JMX exporter provided by confluent.
https://github.com/confluentinc/cp-helm-charts/blob/master/charts/cp-ksql-server/templates/jmx-configmap.yaml
The problem is after defining service id as ksql_click_live, the metric name presents as
cp_ksql_server_metrics_confluent_ksql_ksql_click_livebytes_consumed_total that _ is missing between the service id and the metric name.
I think the service id does not append the metric properly. A workaround is to add _ after the service.id, but then the topic name also has one more _.
Is there a better approach than adding _ after the service.id?
Related
I implemented some CDS views with associations on a SAP NETWEAVER 7.5 SP 19 (09/2020) system.
I used in the SEGW transaction the reference by data source feature to automatically create the ODATA types and associations from the CDS views and add them to a existing SEGW ODATA project.
Then I use that ODATA service in a SAPUI5 app.
Here is one of the guides i used: https://www.saplearners.com/create-odata-service-abap-cds-views-segw/
CDS view
The CDS view is named like /ID/VIEW_NAME_CDS.
The associations are renamed with as and get an underscore before the name. The name is then _assication_name. The underscore seems to be a convention by SAP to make the navigation property readable.
Result
In the SEGW project the wizard creates a Entity Type with the name: xidxview_name_cdsType
Every slash will be replaced by an x and at the end Type will be added.
The navigation property is named to_assication_name.
The association gets a name like assoc_0D6ADC4B279EADE543738376111F7216.
Goal
I want to change the name of the entity types, associations and navigation properties because I want some readable names in the sapui5 app
Clarification 2020/11/30: The name should also be changed in the SEGW transaction itself so that they are the same in SEGW and SAPUI5 because some months in the future annother developer will not think that I changed the names in the MPC_EXT class. At least I wouldn't think of that. :-)
Is this possible with annotations in the CDS view? Or any other way?
Example
#AbapCatalog.sqlViewName: 'ZTEST'
#AbapCatalog.compiler.compareFilter: true
#AbapCatalog.preserveKey: true
#AccessControl.authorizationCheck: #CHECK
#EndUserText.label: 'A test'
define view /ABC/SYSTEM_RESULT_CDS as
select from system as system
association [1..*] to /abc/s_mon_result as _monitoring_results on _monitoring_results.system_id = $projection.system_id
{
key system.system_id,
system.name,
_monitoring_results
}
group by system.system_id
Entity Type: xabcxsystem_result_cdsType
This a mix of camel case style and snake case. Not very readable.
Navigation Properties: to_monitoring_results
Is ok but i would like to have the oportunity to rename it.
Association: assoc_0D6ADC4B279EADE543738376111F7216
Not readable. Only if you click on it you see the 2 entities to which the association belongs.
You have to redefine DEFINE method of MPC_EXT class, the runtime artifact after service generation:
super->define( ).
DATA: lo_entity_type TYPE REF TO /iwbep/if_mgw_odata_entity_typ,
lo_entity_set TYPE REF TO /iwbep/if_mgw_odata_entity_set,
lo_property TYPE REF TO /iwbep/if_mgw_odata_property.
" for entity type
lo_entity_type = model->get_entity_type( 'C_Cfd_UsageType' ).
lo_entity_type->set_name( iv_name = 'CFDUsage' ).
" for association
lo_entity_type = model->get_association( 'C_CFD_Assoc' ).
lo_entity_set->set_name( iv_name = 'CFDAssociation' ).
" for entity set
lo_entity_set = model->get_entity_set( 'C_Cfd_Usage' ).
lo_entity_set->set_name( iv_name = 'CFD' ).
After that new names will be reflected in the service $metadata:
I'm writing lua scripts for PowerDNS.
I wish to get some kind of a unique ID for each DNS query when my script intercepts a DNS query.
I'm intercepting the DNS queries with the "preresolve" and "postresolve" functions and they don't have any unique ID that will symbolize the current DNS query it's handling.
I saw that when using the function "ipfilter", I can use the GetID() function to get the DNS query ID.
This ability is missing in the "preresolve" and "postresolve" functions.
Any ideas?
After upgrading from PDNS Recursor version 3.0 to 4.0 I found my answer.
In version 4, 'preresolve' and 'postresolve' functions get the dq (DNSQuestion) object,
the dq object contains two fields that can help with the query ID.
One, you can use the original query ID by getting the value from
dq:getDH():getID()
Two, dq can contain a custom LUA object reference that is persistent throughout the lifetime of the dq object.
local data={}
data["domaindetails"]= dq.udpAnswer
dq.data=data
Find more details in their Scripting manual:
https://doc.powerdns.com/md/recursor/scripting/#the-dnsquestion-dq-object
I have created a type provider to a service that requires authentication by user name and password. The signature for creating the typed instance is something like this:
let tbl = new DemoTable<TableId="demo",User="user",Password="password">()
It all works just fine, the only problem is that I want to demonstrate this code, so I'd like the user name and password to come from some other source - a configuration file, another F# module (good approach when using scripting), etc.
What are my options for passing these parameters so they are not exposed in the course of demonstration?
One simple way is to use literals in a file that you don't show:
module MyInfo =
[<Literal>]
let user = "user name here"
[<Literal>]
let pwd = "password here"
And then in the file that you do show:
let tbl = new DemoTable<TableId="demo",User=MyInfo.user,Password=MyInfo.pwd>()
Specifying the user name and password directly as static parameters is certainly useful in interactive scripting scenarios. But as you say, sometimes it is also useful to keep those in a separate configuration file. F# does not come with any library that would make this easier, but you can implement the same pattern as, for example, the SqlDataConnection type provider which provides both options (see MSDN docs).
You can either specify the whole connection string:
type DB = SqlDataConnection<ConnectionString="Source=.; User=me; Password=mysecret">
or can either specify local config file and key name:
type DB = SqlDataConnection<ConnectionStringName="LocalDb", ConfigFile="App.config">
This is something that you'd have to implement in your type provider, but it seems like the best way to support both scenarios.
Change password on database (or make temporary user)->compile project->rechange password (or delete user).
I was thinking of using MKNetworkKit as base for Network operations for an iOS App. I'm a bit confused about using the initWithHostName:customerHeaders: and initWithHostName: apiPath:customerHeaders: methods.
In the App, I need to communicate to a number of hosts and they have different ways of specifying the Host Name and URL. For example:
HostNameX.com - The Domain Name for HostX,
The first host has the service prepended to the Hostname as so:
serviceA.HostNameX.com?someparam=value The Path for ServiceA (returns info)
serviceB.HostNameX.com?someparam=value The Path for ServiceB (returns info)
HostNameY.com - The Domain Name for HostY
The second host has the service or command appended to the Hostname as so:
HostNameY.com/serviceA?someparam =value The Path for ServiceA (returns info)
HostNameY.com/serviceB?someparam =value The Path for ServiceB (returns info)
For the HostNameY.com case, I was thinking of creating one MKEngine Instance and then passing in the "serviceA?someparam=value" or "serviceB?someparam=value" string as the Path parameter to the operationWithPath:params:httpMethod:ssl: method.
This would work well for what I want to do, however for HostNameX.com I'm not sure how to prepend "serviceA." or "serviceB." to the host name? The only way I can see of doing it is to create two separate MKEngine Instances one for "serviceA" and one for "serviceB". Is this the case?
Am I missing something or is there a way to be able to prepend the service to the domain name after calling initWithHostName:apiPath:customerHeaders: ?
Thanks in advance for any suggestions.
All the Best
Dave
For HostNameY.com, you are right. The service name can be part of the path.
And as you mentioned, you should use multiple instances of MKEngine to manage HostNameX.com.
Why you should use multiple instances :
Hostname is a private property of MKNetworkEngine and the only way to change the hostname is to create a new instance of MKNetworkEngine (without modifying MKNetworkEngine). Hostname property is used by MKNetworkEngine to observe Reachability changes and freeze/restore operations. If you change the hostname at runtime for a single instance of MKNetworkEngine (by making hostname property public for example), this feature won't work well on all situations. Just take a look at freezeOperations (called when you loose network) method in MKNetworkEngine.m. It checks if and operation url contains the current hostname. If you have changed the hostname and the operation was created for another host, the operation will not be archived to restore it later when the network is back.
I solved this problem by using the operationWithURLString and building my own URL String. To me anyway, this seems a much better solution than allocating a number of MKEngine Instances just to handle something that can be passed as a parameter. This way I can also append path components as well as parameters to the URL String, for example:
http://serviceA.hostname.com/fred/simmons?isvip=true&hasBooked=false
Interestingly, the parameter dictionary that is passed to operationWithURLString:params:httpMethod: works in two ways:
if the httpMethod is GET, then the dictionary is used to pass parameters in the URL, if the httpMethod is POST or PUT (or DELETE?) then the Dictionary is formatted and sent as the Request Body.
Question - is it valid to have a POST Command with parameters?
For example:
http://bookingservice.hostname.com/bookings?isvip=true&lastname=simmons
Is this a valid URL as a POST not a GET?
When the same app acts as a Bonjour-enabled service and client at the same time, browsing for self-like services while listening on a socket, what's a good way to exclude self from service search results?
In your NSNetServiceBrowserDelegate you can just ask the incoming service if it is the same as the one you have published:
-(void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didFindService:(NSNetService *)netService moreComing:(BOOL)moreComing
{
if ([netService isEqual:self.publishedNetService])
return;
…
}
In the server part, when I register my service with Bonjour, I generate a 10 character random alphanumeric string - a cookie. I make it a part of the advertised service name, as provided in call to [NSNetService initWithDomain:type:name:port:]. The resulting name is something like "MyApp on Joe's iPhone\txYbG56HjaE". The part before the tab character is for display, the part after is the cookie. I then store the cookie is a globally visible variable. Since server initialization takes place on app startup, the cookie value is available early on.
In the service discovery part, when I find a service, I check its name; if the cookie is the same as the stored global one, I skip this service. The idea is that other running instances of the program would have different cookie values, because randomness.
Naturally, when displaying discovered service names in the UI, I skip the part after the tab character.