Nova postagem

Pesquisar

Pergunta
· Mar. 13, 2024

Change Stream Property in Ens.StreamContainer with DTL

I'm trying to change the Stream property inside a DTL with a Source Class of Ens.StreamContainer. The code, below, will change it within the DTL testing tool, but running an actual message through the Production's Process doesn't change the Stream property. I can change other properties of Ens.StreamContainer by using the normal Set action and it is reflected when running it through the Process. For context, this uses a FTP service to grab a file. Any thoughts on why I can't just write modified stream data to the Stream property?

I use target here because I'm using the DTL copy function to preserve the OriginalFileName property.

1 set   streamData  target.Stream.Read(target.Stream.Size)  ""   
2 set   streamData  $REPLACE(streamData,"header1,header2"...  ""   
3 code     do target.Stream.Write(streamData)     
7 Comments
Discussão (7)2
Entre ou crie uma conta para continuar
Artigo
· Mar. 13, 2024 5min de leitura

OpenTelemetry Traces from IRIS implemented SOAP Web Services

A customer recently asked if IRIS supported OpenTelemetry as they where seeking to measure the time that IRIS implemented SOAP Services take to complete. The customer already has several other technologies that support OpenTelemetry for process tracing.  At this time, InterSystems IRIS (IRIS) do not natively support OpenTelemetry.  

It's fair to say that IRIS data platform has several ways to capture, log and analyse the performance of a running instance, this information does not flow out of IRIS through to other opentelemetry components like Agents or Collectors within an implemented OpenTelemetry architecture.  Several technologies already support OpenTelemetry which seems to bet becoming a defacto standard for Observability.

Whilst there is ongoing development to natively support this capability in future IRIS releases, this article explains how, with the help of the Embedded Python and the corresponding Python libraries, IRIS application developers can start publishing Trace events to your OpenTelemetry back-ends with minimal effort.  More importantly, this gives my customer something to get up and running with today. 

 

Observability. 

Observability in generally comprises three main aspects:

  • Metrics capture, which is the capture of quantitative measuremements about the performance and behaviour of a system, similar to what IRIS publishes via its /api/monitor/metrics api
  • Logging, which involves capturing and storing relevant information generated by an application or system, such as what appears in System Log outputs, or messages.log file generated by IRIS instances.
  • Tracing: which involves tracking the flow of a service request or transaction as it moves through various components of a solution. Distributed tracing allows you to follow the path of a request across multiple services, providing a visual representation of the entire transaction flow.

This article and accompanying application found here, focuses solely on Tracing oSOAP Services.

A Trace identifies an operation within a solution that, in fact, can be satisfied via multiple technologies in an architecture, such as browser, load balance, web server, database server, etc.
A Span represents a single unit of work, such as a database update, or database query. A span is the building block of a Trace, and a Trace starts with a root Span, and optionally nested, or siblinkg spans.

In this implementation which is only using IRIS as the technology to generate telemetry, a Trace and root Span is started when the SOAP Service is started.

Approach for implementation:

Subclass IRIS's %SOAP.WebService class with OpenTelemetry implementation logic and Python library functions in a new calss called SOAP.WebService. Include Macros that can be used in user code to further contribute to observability and tracing. Minimal changes to the existing SOAP implementation should be needed (replace use of %SOAP.WebService with SOAP.WebService as the Web Service superclass for implementing SOAP.
The diagram below illustrates this approach:

 

Features of this implementation:

  • By default, every SOAP Service will be tracked and reports trace information.
  • When a SOAP Service is used for the first time, the implementation will initalise an OpenTelemetry Tracer object. A combination of the IRIS Server name and Instance is provided as the telemetry source, and, the SOAP Action used as th name for the default root span tracking the soap service.
  • Telemetry traces and the default span will be automatically closed when the SOAP method call ends
  • Upon creation, Key/Value pairs of attributes can be added to the default root span, such as, CSP Session ID, or Job number
  • Users may use the $$$OTELLog(...), to add an arbitratry manual logging into a span, using a simple string or array of key valye pairs 
  • Users may use the $$$OTELPushChildSpan(...)/$$$OTELPopChildSpan(...) to create non-root spans around sections of code which they want to independantly identify with their logic

 

Installation and testing

  • Clone/git pull the repo into any local directory
$ git clone https://github.com/pisani/opentelemetry-trace-soap.git
  • Open a terminal window in this directory and type the following to build the IRIS images with sample code:
$ docker-compose build
  • Once the iris image is build, in the same directory type the following to start up the Jaeger and IRIS containers:
$ docker-compose up -d

This will startup two containers - the Jaeger OpenTelemetry target backend container (also exposing a user interface), and, an instance of IRIS which will serve as the SOAP Web Services server endpoint.  Three simple webservices have been developed in the IRIS instance for testing the solution.

 

  • Using your browser access the SOAP Information and testing pages via this URL. logging in as superuser/SYS if prompted:
http://localhost:52773/csp/irisapp/SOAP.MyService.cls

(Note: These pages are not enabled by default and security within the running IRIS instance had to be relaxed to enable this feature, for ease of testing)

Select each of the web methods you want to test, in order to generate SOAP activity.  To see this implementation generate an Error in the observed traces, use zero (0) as the second number in the Divide() SOAP method in order to force a <DIVDE> error.

  • Open another browser tab pull up the Jaeger UI via the following URL
http://localhost:16686
  • The resulting landing page shows you all services contributing telemetry readings and should look something similar to the screenshot below:  

 

Conclusion

In summary, this article demonstrates how Embedded Python, could be used to add additional features to IRIS, in my case, to implement Observability tracing for SOAP services.  The options available via Python and IRIS's ability to leverage these Python libraries is truely.

I recognise that work can be undertaken to create a more generic OpenTelemetrySupport class that implements the same for REST services, as well as extending current Class Method signatures to tracking timing of any Class method through this framework.

5 Comments
Discussão (5)3
Entre ou crie uma conta para continuar
Pergunta
· Mar. 13, 2024

How to send PUT using HS.FHIR.DTL.Util.HC.SDA3.FHIR.Process?

Dear,

I'm trying to configure a new interface that reads HL7, transform them into FHIR messages and then send POST or PUT or DELETE depending on HL7 doc type.

1-I added an HL7 TCP service that reads ADTs messages

2a-Send ADTs to a process to transform them into SDA  (using the following command:  do ##class(HS.Gateway.HL7.HL7ToSDA3).GetSDA(request,.con))

2b-Extract the patient MRN and add it to the AdditionalInfo property  (using the following request message class: HS.Message.XMLMessage)

3-Send the SDA message to the built in process: HS.FHIR.DTL.Util.HC.SDA3.FHIR.Process.

4-Send FHIR request to HS.FHIRServer.Interop.Operation

My only problem is that every ADT message is being transformed to a POST FHIR message.

Can you help me to control the method that is being used (POST)? and t change it to a PUT or DELETE when needed? 

5 Comments
Discussão (5)2
Entre ou crie uma conta para continuar
Discussão
· Mar. 12, 2024

[Water Cooler Talk] Is ChatGPT effective in providing ObjectScript guide?

Hi Community!

As an AI language model, ChatGPT is capable of performing a variety of tasks like language translation, writing songs, answering research questions, and even generating computer code. With its impressive abilities, ChatGPT has quickly become a popular tool for various applications, from chatbots to content creation.
But despite its advanced capabilities, ChatGPT is not able to access your personal data. So we need to build a custom ChatGPT AI by using LangChain Framework:

Below are the steps to build a custom ChatGPT:

  • Step 1: Load the document 

  • Step 2: Splitting the document into chunks

  • Step 3: Use Embedding against Chunks Data and convert to vectors

  • Step 4: Save data to the Vector database

  • Step 5: Take data (question) from the user and get the embedding

  • Step 6: Connect to VectorDB and do a semantic search

  • Step 7: Retrieve relevant responses based on user queries and send them to LLM(ChatGPT)

  • Step 8: Get an answer from LLM and send it back to the user

 

  For more details, please Read this article


My personal conclusion
 

In my personal opinion, ChatGPT is effective in providing ObjectScript code and examples, especially for simpler tasks or basic programming concepts. It can generate code snippets, explain programming concepts, and even provide examples or solutions to specific coding problems. However, the effectiveness may vary depending on the complexity of the task and the specific programming language involved. ChatGPT can be quite helpful in providing code examples and explanations.

6 Comments
Discussão (6)5
Entre ou crie uma conta para continuar
Artigo
· Mar. 12, 2024 5min de leitura

Orchestrating Secure Management Access in InterSystems IRIS with AWS EKS and ALB

As an IT and cloud team manager with 18 years of experience with InterSystems technologies, I recently led our team in the transformation of our traditional on-premises ERP system to a cloud-based solution. We embarked on deploying InterSystems IRIS within a Kubernetes environment on AWS EKS, aiming to achieve a scalable, performant, and secure system. Central to this endeavor was the utilization of the AWS Application Load Balancer (ALB) as our ingress controller. 

However, our challenge extended beyond the initial cluster and application deployment; we needed to establish an efficient and secure method to manage the various IRIS instances, particularly when employing mirroring for high availability.

This post will focus on the centralized management solution we implemented to address this challenge. By leveraging the capabilities of AWS EKS and ALB, we developed a robust architecture that allowed us to effectively manage and monitor the IRIS cluster, ensuring seamless accessibility and maintaining the highest levels of security. 

In the following sections, we will delve into the technical details of our implementation, sharing the strategies and best practices we employed to overcome the complexities of managing a distributed IRIS environment on AWS EKS. Through this post, we aim to provide valuable insights and guidance to assist others facing similar challenges in their cloud migration journeys with InterSystems technologies.

Configuration Summary Our configuration capitalized on the scalability of AWS EKS, the automation of the InterSystems Kubernetes Operator (IKO) 3.6, and the routing proficiency of AWS ALB. This combination provided a robust and agile environment for our ERP system's web services.

Mirroring Configuration and Management Access We deployed mirrored IRIS data servers to ensure high availability. These servers, alongside a single application server, were each equipped with a Web Gateway sidecar pod. Establishing secure access to these management portals was paramount, achieved by meticulous network and service configuration.

Detailed Configuration Steps

Initial Deployment with IKO:

  • We leveraged IKO 3.6, we deployed the IRIS instances, ensuring they adhered to our high-availability requirements.

Web Gateway Management Configuration:

  • We create server access profiles within the Web Gateway Management interface. These profiles, named data00 and data01, were crucial in establishing direct and secure connectivity to the respective Web Gateway sidecar pods associated with each IRIS data server.
  • To achieve precise routing of incoming traffic to the appropriate Web Gateway, we utilized the DNS pod names of the IRIS data servers. By configuring the server access profiles with the fully qualified DNS pod names, such as iris-svc.app.data-0.svc.cluster.local and iris-svc.app.data-1.svc.cluster.local, we ensured that requests were accurately directed to the designated Web Gateway sidecar pods.

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

 

IRIS Terminal Commands:

  • To align the CSP settings with the newly created server profiles, we executed the following commands in the IRIS terminal:
    • d $System.CSP.SetConfig("CSPConfigName","data00") # on data00
    • d $System.CSP.SetConfig("CSPConfigName","data01") # on data01

https://docs.intersystems.com/healthconnectlatest/csp/docbook/DocBook.UI...

NGINX Configuration:

  • The NGINX configuration was updated to respond to /data00 and /data01 paths, followed by creating Kubernetes services and ingress resources that interfaced with the AWS ALB, completing our secure and unified access solution.

Creating Kubernetes Services:

  • I initiated the setup by creating Kubernetes services for the IRIS data servers and the SAM:

 

Ingress Resource Definition:

  • Next, I defined the ingress resources, which route traffic to the appropriate paths using annotations to secure and manage access.

Explanations for the Annotations in the Ingress YAML Configuration:

  • alb.ingress.kubernetes.io/scheme: internal
    • Specifies that the Application Load Balancer should be internal, not accessible from the internet.
    • This ensures that the ALB is only reachable within the private network and not exposed publicly.
  • alb.ingress.kubernetes.io/subnets: subnet-internal, subnet-internal
    • Specifies the subnets where the Application Load Balancer should be provisioned.
    • In this case, the ALB will be deployed in the specified internal subnets, ensuring it is not accessible from the public internet.
  • alb.ingress.kubernetes.io/target-type: ip
    • Specifies that the target type for the Application Load Balancer should be IP-based.
    • This means that the ALB will route traffic directly to the IP addresses of the pods, rather than using instance IDs or other target types.
  • alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true
    • Enables sticky sessions (session affinity) for the target group.
    • When enabled, the ALB will ensure that requests from the same client are consistently routed to the same target pod, maintaining session persistence.
  • alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 443}]'
    • Specifies the ports and protocols that the Application Load Balancer should listen on.
    • In this case, the ALB is configured to listen for HTTPS traffic on port 443.
  • alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:il-
    • Specifies the Amazon Resource Name (ARN) of the SSL/TLS certificate to use for HTTPS traffic.
    • The ARN points to a certificate stored in AWS Certificate Manager (ACM), which will be used to terminate SSL/TLS connections at the ALB.

These annotations provide fine-grained control over the behavior and configuration of the AWS Application Load Balancer when used as an ingress controller in a Kubernetes cluster. They allow you to customize the ALB's networking, security, and routing settings to suit your specific requirements.

After configuring the NGINX with location settings to respond to the paths for our data servers, the final step was to extend this setup to include the SAM by defining its service and adding the route in the ingress file.

Security Considerations: We meticulously aligned our approach with cloud security best practices, particularly the principle of least privilege, ensuring that only necessary access rights are granted to perform a task.

DATA00:

 

DATA01:

SAM:

Conclusion: 

This article shared our journey of migrating our application to the cloud using InterSystems IRIS on AWS EKS, focusing on creating a centralized, accessible, and secure management solution for the IRIS cluster. By leveraging security best practices and innovative approaches, we achieved a scalable and highly available architecture.

We hope that the insights and techniques shared in this article prove valuable to those embarking on their own cloud migration projects with InterSystems IRIS. If you apply these concepts to your work, we'd be interested to learn about your experiences and any lessons you discover throughout the process

3 Comments
Discussão (3)1
Entre ou crie uma conta para continuar